mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-07-15 23:13:42 +08:00
Synchronization code
This commit is contained in:
parent
8009e9cda1
commit
c25501bdd7
@ -111,9 +111,9 @@ namespace SqlSugar
|
||||
}
|
||||
public StorageableCommonMethodInfo IgnoreColumns(params string[] ignoreColumns)
|
||||
{
|
||||
PropertyInfo property = ObjectValue.GetType().GetProperty(type);
|
||||
var value = property.GetValue(ObjectValue);
|
||||
var newObj = value.GetType().GetMyMethod("IgnoreColumns", 1, typeof(string[])).Invoke(value, new object[] { ignoreColumns });
|
||||
PropertyInfo property = ObjectValue?.GetType().GetProperty(type);
|
||||
var value = property?.GetValue(ObjectValue);
|
||||
var newObj = value?.GetType().GetMyMethod("IgnoreColumns", 1, typeof(string[])).Invoke(value, new object[] { ignoreColumns });
|
||||
StorageableCommonMethodInfo result = new StorageableCommonMethodInfo();
|
||||
result.Value = newObj;
|
||||
return result;
|
||||
@ -124,6 +124,7 @@ namespace SqlSugar
|
||||
public object Value { get; set; }
|
||||
public int ExecuteCommand()
|
||||
{
|
||||
if(Value == null) return 0;
|
||||
var newObj = Value.GetType().GetMethod("ExecuteCommand").Invoke(Value, new object[] { });
|
||||
return (int)newObj;
|
||||
}
|
||||
|
@ -57,7 +57,9 @@ namespace SqlSugar
|
||||
var sqlTemp = ($" UPDATE {tableWithString} SET {{0}} WHERE {{1}};\r\n");
|
||||
List<SugarParameter> parameters = new List<SugarParameter>();
|
||||
Check.ExceptionEasy(wheres?.Any() != true, "Updates cannot be without a primary key or condition", "更新不能没有主键或者条件");
|
||||
foreach (var item in this.Context.Updateable(updateObjects).UpdateBuilder.DbColumnInfoList.GroupBy(it => it.TableId))
|
||||
var sqlDb = this.Context.CopyNew();
|
||||
sqlDb.Aop.DataExecuting = null;
|
||||
foreach (var item in sqlDb.Updateable(updateObjects).UpdateBuilder.DbColumnInfoList.GroupBy(it => it.TableId))
|
||||
{
|
||||
Check.ExceptionEasy(item?.ToList()?.Any() != true, "Set has no columns", "更新Set没有列");
|
||||
StringBuilder setString = new StringBuilder();
|
||||
|
Loading…
Reference in New Issue
Block a user