コード例 #1
0
ファイル: Column.cs プロジェクト: throw-out/sqlite3_for_unity
        public ColumnProp(PropertyInfo prop)
        {
            this._prop      = prop;
            this.ColumnType = Nullable.GetUnderlyingType(prop.PropertyType) ?? prop.PropertyType;
            //Name
            var attr = (ColumnAttribute)prop.GetCustomAttributes(typeof(ColumnAttribute), true).FirstOrDefault();

            this.Name = attr?.Name ?? prop.Name;
            //State
            this.IsPK         = Orm.IsPK(prop);
            this.IsAutoInc    = this.IsPK && Orm.IsAutoInc(prop);
            this.IsUnique     = Orm.IsUnique(prop);
            this.IsNotNull    = Orm.IsNotNull(prop);
            this.DefaultValue = Orm.DefaultValue(prop);
            this.MaxLength    = Orm.MaxLength(prop);
        }