【发布时间】:2009-10-23 08:38:20
【问题描述】:
我目前有一个函数:
public static Attribute GetAttribute(MemberInfo Member, Type AttributeType)
{
Object[] Attributes = Member.GetCustomAttributes(AttributeType, true);
if (Attributes.Length > 0)
return (Attribute)Attributes[0];
else
return null;
}
我想知道是否值得将属性上的所有属性缓存到
Attribute = _cache[MemberInfo][Type]字典,
这需要使用不带任何类型参数的GetCustomAttributes,然后枚举结果。值得吗?
【问题讨论】:
标签: c# performance reflection