mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-20 02:29:39 +08:00
Updated 达梦 CodeFirst
This commit is contained in:
@@ -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)
|
||||||
{
|
{
|
||||||
|
@@ -18,6 +18,8 @@ namespace SqlSugar
|
|||||||
csharpTypeName = "long";
|
csharpTypeName = "long";
|
||||||
if (csharpTypeName.ToLower().IsIn("boolean", "bool"))
|
if (csharpTypeName.ToLower().IsIn("boolean", "bool"))
|
||||||
csharpTypeName = "bool";
|
csharpTypeName = "bool";
|
||||||
|
if (csharpTypeName == "Guid")
|
||||||
|
csharpTypeName = "string";
|
||||||
if (csharpTypeName == "DateTimeOffset")
|
if (csharpTypeName == "DateTimeOffset")
|
||||||
csharpTypeName = "DateTime";
|
csharpTypeName = "DateTime";
|
||||||
var mappings = this.MappingTypes.Where(it => it.Value.ToString().Equals(csharpTypeName, StringComparison.CurrentCultureIgnoreCase));
|
var mappings = this.MappingTypes.Where(it => it.Value.ToString().Equals(csharpTypeName, StringComparison.CurrentCultureIgnoreCase));
|
||||||
|
@@ -28,6 +28,10 @@ namespace SqlSugar
|
|||||||
if (propertyType.Name.Equals("Guid", StringComparison.CurrentCultureIgnoreCase))
|
if (propertyType.Name.Equals("Guid", StringComparison.CurrentCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
result.DataType = this.Context.Ado.DbBind.GetDbTypeName(UtilConstants.StringType.Name);
|
result.DataType = this.Context.Ado.DbBind.GetDbTypeName(UtilConstants.StringType.Name);
|
||||||
|
if (result.Length <= 1)
|
||||||
|
{
|
||||||
|
result.Length = 36;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user