获取反射字段

获取反射字段     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

  

posted @ 2021-12-24 16:45  巴蒂尔  阅读(14)  评论(0编辑  收藏  举报