BaseRepository新增update方法

This commit is contained in:
不做码农 2022-01-18 21:52:23 +08:00
parent 72b2166e40
commit 92755a26c8
2 changed files with 6 additions and 3 deletions

View File

@ -120,7 +120,10 @@ namespace ZR.Repository
#endregion add #endregion add
#region update #region update
public IUpdateable<T> Updateable(T entity)
{
return Context.Updateable(entity);
}
public int Update(T entity, bool ignoreNullColumns = false) public int Update(T entity, bool ignoreNullColumns = false)
{ {
return Context.Updateable(entity).IgnoreColumns(ignoreNullColumns).ExecuteCommand(); return Context.Updateable(entity).IgnoreColumns(ignoreNullColumns).ExecuteCommand();
@ -132,7 +135,7 @@ namespace ZR.Repository
} }
/// <summary> /// <summary>
/// 根据实体类更新 egUpdate(dept, it => new { it.Status }, f => depts.Contains(f.DeptId));只更新Status列条件是包含 /// 根据实体类更新指定列 egUpdate(dept, it => new { it.Status }, f => depts.Contains(f.DeptId));只更新Status列条件是包含
/// </summary> /// </summary>
/// <param name="entity"></param> /// <param name="entity"></param>
/// <param name="expression"></param> /// <param name="expression"></param>

View File

@ -43,7 +43,7 @@ namespace ZR.Repository
#endregion add #endregion add
#region update #region update
IUpdateable<T> Updateable(T entity);
int Update(T entity, bool ignoreNullColumns = false); int Update(T entity, bool ignoreNullColumns = false);
/// <summary> /// <summary>