[AttributeUsage(AttributeTargets.Field)]
    public class UColumn : Attribute
    {
        public DBField type;        public UColumn(DBField type)
        {
            this.type = type;
        }
    }
    [AttributeUsage(AttributeTargets.Class)]
    public class UTable : Attribute
    {
        public string tableName;
        public UTable(string tableName)
        {
            tableName = tableName ?? throw new ArgumentNullException(nameof(tableName));
        }    }
先定义了俩attribute,一个作用在类上,一个作用在字段上,然后
[UTable("T_Content")]
    public class T_Content
    {
        [UColumn(DBField.None)]
        private string contentID;
        private string content_AlarmID;
        private string message;
        private string user;
        private DateTime? dateTime = null;
        public string ContentID { get => contentID; set => contentID = value; }
        public string Content_AlarmID { get => content_AlarmID; set => content_AlarmID = value; }
        public string Message { get => message; set => message = value; }
        public string User { get => user; set => user = value; }
        public DateTime? DateTime { get => dateTime; set => dateTime = value; }        
    }
实体类上加attribute
然后测试 发现可以获取到UTable但是获取不到UColumn
然后是测试代码: