Exemplo n.º 1
0
        static public void CopyTo(this EntityColumn it, IEntitySchema columnDef)
        {
            var attris = it.GetAttributesEntity();

            columnDef.ColumnName   = it.ColumnName;
            columnDef.DataType     = string.IsNullOrEmpty(it.DataType) ? defaultDataType : it.DataType;
            columnDef.FieldType    = attris.FieldType.ToString();
            columnDef.AliasType    = attris.AliasType;
            columnDef.KeyGen       = attris.KeyGen;
            columnDef.Unique       = it.Unique;
            columnDef.DefaultValue = (it.DefaultValue == null) ? null : it.DefaultValue.ToString();
        }
Exemplo n.º 2
0
        static public void CopyTo(this IEntitySchema it, EntityColumn column)
        {
            var attris = column.GetAttributesEntity();

            column.ColumnName = it.ColumnName;
            if (!string.IsNullOrEmpty(it.FieldType))
            {
                attris.FieldType = (EntityFieldType)Enum.Parse(typeof(EntityFieldType), it.FieldType, true);
            }
            attris.AliasType    = it.AliasType;
            column.DataType     = (attris.FieldType == EntityFieldType.Var && string.IsNullOrEmpty(it.DataType)) ? defaultDataType : it.DataType;
            attris.KeyGen       = it.KeyGen;
            column.Unique       = it.Unique;
            column.DefaultValue = string.IsNullOrEmpty(it.DefaultValue) ? null : it.DefaultValue;
        }