mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-10-15 18:55:07 +08:00
Update Storageable
This commit is contained in:
@@ -93,10 +93,10 @@ namespace SqlSugar
|
||||
{
|
||||
var column = this.Context.EntityMaintenance.GetEntityInfo<T>().Columns.FirstOrDefault(it=>it.IsPrimarykey);
|
||||
if (column == null) Check.ExceptionEasy("DefaultAddElseUpdate() need primary key", "DefaultAddElseUpdate()这个方法只能用于主键");
|
||||
var defaultValue = default(T);
|
||||
return this.SplitUpdate(it =>
|
||||
{
|
||||
var itemPkValue = column.PropertyInfo.GetValue(it.Item);
|
||||
var defaultValue =UtilMethods.GetDefaultValue(column.PropertyInfo.PropertyType);
|
||||
var result= itemPkValue != null && itemPkValue.ObjToString() != defaultValue.ObjToString();
|
||||
return result;
|
||||
|
||||
|
Reference in New Issue
Block a user