Reflection_1

1.获取Model的Attribute

var auditAttr=dbEntry.Entity.GetType().GetCustomAttribute(typeof(AuditableAttribute),false).SingleOrDefault() as AuditableAttribute.
var auditAttr=Attributes.GetCustomAttribute(dbEntry.Entity.GetType(),typeof(AuditableAttribute),false) as AuditableAttribute.

second p.

猜你喜欢

转载自www.cnblogs.com/sujingnuli/p/9181572.html
今日推荐