|
|
@ -81,5 +81,33 @@ namespace SqlSugar |
|
|
|
{ |
|
|
|
return EntityColumnToDbColumn(entity,dbTableName,item); |
|
|
|
} |
|
|
|
|
|
|
|
protected override void GetDbType(EntityColumnInfo item, Type propertyType, DbColumnInfo result) |
|
|
|
{ |
|
|
|
if (!string.IsNullOrEmpty(item.DataType)) |
|
|
|
{ |
|
|
|
result.DataType = item.DataType; |
|
|
|
} |
|
|
|
else if (propertyType.IsEnum()) |
|
|
|
{ |
|
|
|
result.DataType = this.Context.Ado.DbBind.GetDbTypeName(item.Length > 9 ? UtilConstants.LongType.Name : UtilConstants.IntType.Name); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
var name = GetType(propertyType.Name); |
|
|
|
if (name == "Boolean") |
|
|
|
{ |
|
|
|
result.DataType = "tinyint"; |
|
|
|
result.Length = 1; |
|
|
|
result.Scale = 0; |
|
|
|
result.DecimalDigits = 0; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
result.DataType = this.Context.Ado.DbBind.GetDbTypeName(name); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|