mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 22:11:36 +08:00
Synchronization code
This commit is contained in:
parent
518dd51fa4
commit
957be334b4
@ -280,7 +280,12 @@ namespace SqlSugar
|
|||||||
foreach (DataColumn item in dataTable.Columns)
|
foreach (DataColumn item in dataTable.Columns)
|
||||||
{
|
{
|
||||||
var isPrimaryKey = whereColumns.Any(it => it.EqualCase(item.ColumnName));
|
var isPrimaryKey = whereColumns.Any(it => it.EqualCase(item.ColumnName));
|
||||||
builder.CreateProperty(item.ColumnName,typeof(Nullable<>).MakeGenericType(item.DataType), new SugarColumn()
|
var propertyType = item.DataType;
|
||||||
|
if (!propertyType.IsClass()&& propertyType!=typeof(string) && propertyType != typeof(byte[]))
|
||||||
|
{
|
||||||
|
propertyType=typeof(Nullable<>).MakeGenericType(UtilMethods.GetUnderType(item.DataType));
|
||||||
|
}
|
||||||
|
builder.CreateProperty(item.ColumnName, propertyType, new SugarColumn()
|
||||||
{
|
{
|
||||||
IsPrimaryKey = isPrimaryKey,
|
IsPrimaryKey = isPrimaryKey,
|
||||||
IsIdentity=isIdentity&& isPrimaryKey,
|
IsIdentity=isIdentity&& isPrimaryKey,
|
||||||
|
Loading…
Reference in New Issue
Block a user