using SqlSugar; using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Text; using System.Threading.Tasks; namespace MyCode.Project.Domain.Repositories { public interface IRepository { /// /// 按字段批量修改一组对象 /// /// /// /// int Update(List updateObjs, Expression> columns) where T : class, new(); /// /// 增加允许跨仓储调用修改方法 /// /// /// /// void UpdateQueue(Expression> columns, Expression> whereExpression) where T : class, new(); /// /// 得到一个更加灵活的查询对象 /// /// /// /// /// /// /// ISugarQueryable Queryable(Expression> joinExpression); /// /// 得到一个更加灵活的查询对象 /// /// /// /// /// /// /// /// ISugarQueryable Queryable(Expression> joinExpression); /// /// 按照列添加 /// /// /// /// void AddQueue(T t, Expression> columns) where T : class, new(); /// /// 加入数据库队列 /// /// /// void AddQueue(T instance, string tablename = null) where T : class, new(); /// /// 得到当前的sql对象hashcode /// /// int GetSqlHashCode(); /// /// 修改实体 /// /// /// void Update(T t) where T : class, new(); /// /// 根据表达式删除 /// /// int Delete(Expression> whereExpression) where T : class, new(); /// /// Union表操作 /// /// /// /// ISugarQueryable UnionAll(params ISugarQueryable[] queryables) where T : class, new(); /// /// 得到一个更加灵活的查询对象 /// /// /// /// ISugarQueryable Queryable(string shortName = "") where T : class, new(); /// /// 一起执行提交 /// int SaveQueue(); /// /// 按照列添加 /// /// /// /// void AddQueue(T t) where T : class, new(); /// /// 按照列添加 /// /// /// void Add(T t) where T : class, new(); /// /// 批量添加 /// /// /// void Add(List t) where T : class, new(); /// /// 得到一个更加灵活的查询对象 /// /// ISugarQueryable Queryable(Expression> joinExpression); /// /// 批量添加 /// /// /// void AddQueue(List list) where T : class, new(); /// /// 按字段修改,满足条件的数据,批量修改的补充。 /// 例子:Update(it => new WorkProcess { Remark = "测试批量修改",SystemType = 0 },p => p.WorkProcessId ==Guid.Parse("7BDDBBD3-B1CD-4C25-93BA-D7BF22032108")); /// /// 要修改的列 /// 要修改的条件 int Update(Expression> columns, Expression> whereExpression) where T : class, new(); /// /// 添加修改的队列 /// /// /// void UpdateQueue(T t) where T : class, new(); /// /// 得到数量 /// /// /// /// int Count(Expression> predicate); /// /// 得到一个更加灵活的查询对象 /// /// /// /// /// /// ISugarQueryable Queryable(Expression> joinExpression); /// /// 判断是否存在 /// /// /// /// bool IsExist(Expression> whereExpression); /// /// 添加一个委托的方式执行事务 /// /// void UseTran(Action action); /// /// 按字段批量修改一组对象 /// /// /// /// int Update(List updateObjs) where T : class, new(); /// /// 按字段批量修改一组对象 /// /// /// /// void UpdateQueue(List updateObjs, Expression> columns) where T : class, new(); /// /// 根据表达式删除 /// /// /// void DeleteQueue(Expression> whereExpression) where T : class, new(); /// /// 清空表数据 /// /// /// void TruncateTable() where T : class, new(); /// /// 清除数据库队列 /// void ClearQueue(); /// /// 修改的队列 /// /// /// void UpdateQueue(List list) where T:class,new(); /// /// 禁止参数转换成NVarchar /// void DisableNVarchar(); /// /// 启用参数转换成NVarchar /// void EnableNVarchar(); } }