mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-05-17 21:49:33 +08:00
Synchronization code
This commit is contained in:
parent
a0c6cf1fd6
commit
6aa268f305
@ -597,7 +597,7 @@ namespace SqlSugar
|
|||||||
return properyTypeName.ToLower() != dataType.ToLower();
|
return properyTypeName.ToLower() != dataType.ToLower();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private static string GetType(string name)
|
protected string GetType(string name)
|
||||||
{
|
{
|
||||||
if (name.IsContainsIn("UInt32", "UInt16", "UInt64"))
|
if (name.IsContainsIn("UInt32", "UInt16", "UInt64"))
|
||||||
{
|
{
|
||||||
|
@ -81,5 +81,33 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
return EntityColumnToDbColumn(entity,dbTableName,item);
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user