Exemple #1
0
            internal Column(PropertyInfo prop)
            {
                this._prop          = prop;
                this._dataConverter = null;

                this.Name = OrmHelper.GetColumnName(prop);
                // If this type is Nullable<T> then Nullable.GetUnderlyingType returns the T,
                // otherwise it returns null, so get the the actual type instead
                this.ColumnType             = OrmHelper.GetColumnType(prop);
                this.EnumType               = OrmHelper.GetEnumType(prop);
                this.Collation              = OrmHelper.GetCollation(prop);
                this.PrimaryKey             = OrmHelper.GetPrimaryKey(prop);
                this.IsNullable             = this.PrimaryKey == null && OrmHelper.GetIsColumnNullable(prop);
                this.IsAutoIncrement        = OrmHelper.GetIsAutoIncrement(prop);
                this.Unique                 = OrmHelper.GetUnique(prop);
                this.MaxStringLength        = OrmHelper.GetMaxStringLength(prop);
                this.Checks                 = OrmHelper.GetChecks(prop);
                this.DefaultValue           = OrmHelper.GetDefaultValue(prop);
                this.DataConverterAttribute = OrmHelper.GetDataConverter(prop);
            }