コード例 #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)
 {
 }