获取反射字段

获取反射字段     Comment
   [DataMember, Field(Name = "Title", Comment = "标题")]


   PropertyInfo[] properties = entityType.GetProperties().Where(o => o.CanWrite && PrimitiveTypes.Contains(o.PropertyType) && !o.GetCustomAttributes(false).OfType<NotMappedAttribute>().Any()).ToArray();


   comment = ((Easy.ORM.FieldBaseAttribute)((System.Attribute[])p.GetCustomAttributes())[1]).Comment;

参考ehr

  

原文地址:https://www.cnblogs.com/lijianhong90/p/15728042.html