protected static AttributeCollection AddDefaultAttributes(ColumnProvider columnProvider, AttributeCollection attributes) { List <Attribute> list = new List <Attribute>(); if ((attributes.FirstOrDefault <RequiredAttribute>() == null) && !columnProvider.Nullable) { list.Add(new RequiredAttribute()); } StringLengthAttribute attribute2 = attributes.FirstOrDefault <StringLengthAttribute>(); int maxLength = columnProvider.MaxLength; if (((attribute2 == null) && (columnProvider.ColumnType == typeof(string))) && (maxLength > 0)) { list.Add(new StringLengthAttribute(maxLength)); } if (list.Count > 0) { attributes = AttributeCollection.FromExisting(attributes, list.ToArray()); } return(attributes); }
public MetaForeignKeyColumn(MetaTable table, ColumnProvider entityMember) : base(table, entityMember) { }
public MetaColumn(MetaTable table, ColumnProvider columnProvider) { this.Table = table; this.Provider = columnProvider; }
public MetaChildrenColumn(MetaTable table, ColumnProvider entityMember) : base(table, entityMember) { }