Esempio n. 1
0
 public void CopyTo(InternalAttribute dest)
 {
     dest.InternalAllowDBNull   = this.InternalAllowDBNull;
     dest.InternalAutoIncrement = this.InternalAutoIncrement;
     dest.InternalColumnName    = this.InternalColumnName;
     dest.InternalDataType      = this.InternalDataType;
     dest.InternalDefaultValue  = this.InternalDefaultValue;
     dest.InternalExpression    = this.InternalExpression;
     dest.InternalUnique        = this.InternalUnique;
     dest.InternalReadOnly      = this.InternalReadOnly;
     dest.InternalComment       = this.InternalComment;
 }
Esempio n. 2
0
        public InternalTemplate(CremaTemplate template, CremaTemplateColumnBuilder builder)
            : base("TableTemplate", PathUtility.Separator)
        {
            base.Target  = template;
            this.builder = builder;

            this.columnID = new InternalAttribute(CremaSchema.ID, typeof(Guid))
            {
                ColumnMapping = MappingType.Hidden,
                AllowDBNull   = false,
                DefaultValue  = Guid.NewGuid()
            };
            this.Columns.Add(this.columnID);

            this.columnTags = new InternalAttribute(CremaSchema.Tags, typeof(string))
            {
                ColumnMapping = MappingType.Attribute,
                DefaultValue  = $"{TagInfo.All}"
            };
            this.Columns.Add(this.columnTags);

            this.columnIsKey = new DataColumn(CremaSchema.IsKey, typeof(bool))
            {
                DefaultValue = false,
                AllowDBNull  = false
            };
            this.Columns.Add(this.columnIsKey);

            this.columnColumnName = new DataColumn(CremaSchema.ColumnName)
            {
                DefaultValue = "Column1",
                AllowDBNull  = false
            };
            this.Columns.Add(this.columnColumnName);

            this.columnDataType = new DataColumn(CremaSchema.DataType)
            {
                DefaultValue = typeof(string).GetTypeName(),
                AllowDBNull  = false
            };
            this.Columns.Add(this.columnDataType);

            this.columnComment = new DataColumn(CremaSchema.Comment);
            this.Columns.Add(this.columnComment);

            this.columnDefaultValue = new DataColumn(CremaSchema.DefaultValue);
            this.Columns.Add(this.columnDefaultValue);

            this.columnAllowNull = new DataColumn(CremaSchema.AllowNull, typeof(bool))
            {
                DefaultValue = true,
                AllowDBNull  = false
            };
            this.Columns.Add(this.columnAllowNull);

            this.columnReadOnly = new DataColumn(CremaSchema.ReadOnly, typeof(bool))
            {
                DefaultValue = false,
                AllowDBNull  = false
            };
            this.Columns.Add(this.columnReadOnly);

            this.columnIsUnique = new DataColumn(CremaSchema.IsUnique, typeof(bool))
            {
                DefaultValue = false,
                AllowDBNull  = false
            };
            this.Columns.Add(this.columnIsUnique);

            this.columnAutoIncrement = new DataColumn(CremaSchema.AutoIncrement, typeof(bool))
            {
                DefaultValue = false,
                AllowDBNull  = false
            };
            this.Columns.Add(this.columnAutoIncrement);

            this.PrimaryKey       = new DataColumn[] { this.columnColumnName };
            this.DefaultView.Sort = $"{CremaSchema.Index} ASC";
        }
Esempio n. 3
0
 internal CremaAttribute(InternalAttribute attribute)
 {
     this.InternalAttribute = attribute;
 }