增加efcore 官方批量更新

This commit is contained in:
2024-03-13 16:13:24 +08:00
parent 54dea66f5f
commit 39a5e8eade
3 changed files with 14 additions and 5 deletions
@@ -232,12 +232,12 @@ namespace IRaCIS.Core.Infra.EFCore
}
//public static async Task<bool> ExecuteUpdateAsync<T>(this IRaCISDBContext _dbContext, Expression<Func<T, bool>> where, Expression<Func<T, T>> updateFactory, Guid updateUserId) where T : Entity
//{
public static async Task<bool> ExecuteUpdateAsync<T>(this IRaCISDBContext _dbContext, Expression<Func<T, bool>> where, Expression<Func<SetPropertyCalls<T>, SetPropertyCalls<T>>> setPropertyCalls) where T : Entity
{
// return await _dbContext.Set<T>().Where(where).ExecuteUpdateAsync(, );
return await _dbContext.Set<T>().Where(where).ExecuteUpdateAsync<T>(setPropertyCalls)>0;
//}
}
#endregion