Synchronization code

This commit is contained in:
sunkaixuan
2024-07-13 11:29:04 +08:00
parent 0fdba8bbf2
commit 67e8aa7098

View File

@@ -280,10 +280,11 @@ namespace SqlSugar
foreach (DataColumn item in dataTable.Columns)
{
var isPrimaryKey = whereColumns.Any(it => it.EqualCase(item.ColumnName));
builder.CreateProperty(item.ColumnName, item.DataType, new SugarColumn()
builder.CreateProperty(item.ColumnName,typeof(Nullable<>).MakeGenericType(item.DataType), new SugarColumn()
{
IsPrimaryKey = isPrimaryKey,
IsIdentity=isIdentity&& isPrimaryKey
IsIdentity=isIdentity&& isPrimaryKey,
IsNullable= true,
});
}