修改仓储Add方法参数

This commit is contained in:
不做码农 2023-02-17 10:54:18 +08:00
parent a8e6d905dc
commit 5e2fc60ba5
2 changed files with 3 additions and 3 deletions

View File

@ -41,9 +41,9 @@ namespace ZR.Repository
/// </summary> /// </summary>
/// <param name="t"></param> /// <param name="t"></param>
/// <returns></returns> /// <returns></returns>
public int Add(T t) public int Add(T t, bool ignoreNull = true)
{ {
return Context.Insertable(t).IgnoreColumns(true).ExecuteCommand(); return Context.Insertable(t).IgnoreColumns(ignoreNullColumn: ignoreNull).ExecuteCommand();
} }
public int Insert(List<T> t) public int Insert(List<T> t)

View File

@ -10,7 +10,7 @@ namespace ZR.Repository
public interface IBaseRepository<T> : ISimpleClient<T> where T : class, new() public interface IBaseRepository<T> : ISimpleClient<T> where T : class, new()
{ {
#region add #region add
int Add(T t); int Add(T t, bool ignoreNull = true);
int Insert(List<T> t); int Insert(List<T> t);
int Insert(T parm, Expression<Func<T, object>> iClumns = null, bool ignoreNull = true); int Insert(T parm, Expression<Func<T, object>> iClumns = null, bool ignoreNull = true);