🔥移除仓储不常用方法

This commit is contained in:
不做码农
2023-08-15 09:37:31 +08:00
parent 31cf1a82f1
commit ff4e857128
6 changed files with 10 additions and 62 deletions

View File

@@ -61,11 +61,11 @@ namespace ZR.Repository
#endregion add
#region update
public IUpdateable<T> Updateable(T entity)
{
return Context.Updateable(entity);
}
//public IUpdateable<T> Updateable(T entity)
//{
// return Context.Updateable(entity);
//}
/// <summary>
/// 实体根据主键更新
/// </summary>
@@ -103,37 +103,6 @@ namespace ZR.Repository
return Context.Updateable(entity).UpdateColumns(expression).Where(where).ExecuteCommand();
}
public int Update(SqlSugarClient client, T entity, Expression<Func<T, object>> expression, Expression<Func<T, bool>> where)
{
return client.Updateable(entity).UpdateColumns(expression).Where(where).ExecuteCommand();
}
/// <summary>
///
/// </summary>
/// <param name="entity"></param>
/// <param name="list"></param>
/// <param name="isNull">默认为true</param>
/// <returns></returns>
public int Update(T entity, List<string> list = null, bool isNull = true)
{
list ??= new List<string>()
{
"Create_By",
"Create_time"
};
return Context.Updateable(entity).IgnoreColumns(isNull).IgnoreColumns(list.ToArray()).ExecuteCommand();
}
//public bool Update(List<T> entity)
//{
// var result = base.Context.Ado.UseTran(() =>
// {
// base.Context.Updateable(entity).ExecuteCommand();
// });
// return result.IsSuccess;
//}
/// <summary>
/// 更新指定列 egUpdate(w => w.NoticeId == model.NoticeId, it => new SysNotice(){ Update_time = DateTime.Now, Title = "通知标题" });
/// </summary>
@@ -160,14 +129,6 @@ namespace ZR.Repository
throw;
}
}
public IStorageable<T> Storageable(T t)
{
return Context.Storageable<T>(t);
}
public IStorageable<T> Storageable(List<T> t)
{
return Context.Storageable(t);
}
/// <summary>
///

View File

@@ -19,7 +19,6 @@ namespace ZR.Repository
#endregion add
#region update
IUpdateable<T> Updateable(T entity);
int Update(T entity, bool ignoreNullColumns = false);
/// <summary>
@@ -32,13 +31,9 @@ namespace ZR.Repository
int Update(T entity, Expression<Func<T, object>> expression, Expression<Func<T, bool>> where);
int Update(SqlSugarClient client, T entity, Expression<Func<T, object>> expression, Expression<Func<T, bool>> where);
int Update(Expression<Func<T, bool>> where, Expression<Func<T, T>> columns);
#endregion update
IStorageable<T> Storageable(T t);
IStorageable<T> Storageable(List<T> t);
DbResult<bool> UseTran(Action action);
DbResult<bool> UseTran(SqlSugarClient client, Action action);