Пример #1
0
        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);
        }
Пример #2
0
 public MetaForeignKeyColumn(MetaTable table, ColumnProvider entityMember) : base(table, entityMember)
 {
 }
Пример #3
0
 public MetaColumn(MetaTable table, ColumnProvider columnProvider)
 {
     this.Table = table;
     this.Provider = columnProvider;
 }
Пример #4
0
 public MetaChildrenColumn(MetaTable table, ColumnProvider entityMember) : base(table, entityMember)
 {
 }