|
@ -50,6 +50,32 @@ namespace SqlSugar |
|
|
} |
|
|
} |
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
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 |
|
|
|
|
|
{ |
|
|
|
|
|
if (propertyType.Name.Equals("Guid", StringComparison.CurrentCultureIgnoreCase)) |
|
|
|
|
|
{ |
|
|
|
|
|
result.DataType = this.Context.Ado.DbBind.GetDbTypeName(UtilConstants.StringType.Name); |
|
|
|
|
|
if (result.Length <= 1) |
|
|
|
|
|
{ |
|
|
|
|
|
result.Length = 36; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
result.DataType = this.Context.Ado.DbBind.GetDbTypeName(propertyType.Name); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
protected override void ConvertColumns(List<DbColumnInfo> dbColumns) |
|
|
protected override void ConvertColumns(List<DbColumnInfo> dbColumns) |
|
|
{ |
|
|
{ |
|
|