572 lines
25 KiB
C#
572 lines
25 KiB
C#
using System;
|
|
using System.Collections.Concurrent;
|
|
using System.Collections.Generic;
|
|
using System.Linq.Expressions;
|
|
using System.Threading.Tasks;
|
|
using APT.Infrastructure.Core;
|
|
namespace APT.Infrastructure.Api
|
|
{
|
|
/// <summary>
|
|
/// 通用接口,可以调用基类方法
|
|
/// </summary>
|
|
/// <typeparam name="TEntity"></typeparam>
|
|
public partial interface ICommonService : IDomainService
|
|
{
|
|
IUnitOfWork UnitWork();
|
|
|
|
#region 实体
|
|
/// <summary>
|
|
/// 查询实体
|
|
/// </summary>
|
|
/// <typeparam name="T"></typeparam>
|
|
/// <param name="id"></param>
|
|
/// <param name="paths"></param>
|
|
/// <returns></returns>
|
|
T GetEntity<T>(string id, params string[] paths) where T : MesEntityBase, new();
|
|
/// <summary>
|
|
/// 查询实体
|
|
/// </summary>
|
|
/// <typeparam name="T"></typeparam>
|
|
/// <param name="id"></param>
|
|
/// <param name="paths"></param>
|
|
/// <returns></returns>
|
|
T GetEntity<T>(Guid id, params string[] paths) where T : MesEntityBase, new();
|
|
/// <summary>
|
|
/// 查询实体
|
|
/// </summary>
|
|
/// <typeparam name="T"></typeparam>
|
|
/// <param name="expression"></param>
|
|
/// <param name="paths"></param>
|
|
/// <returns></returns>
|
|
T GetEntity<T>(Expression<Func<T, bool>> expression, params string[] paths) where T : MesEntityBase, new();
|
|
/// <summary>
|
|
/// 查询实体
|
|
/// </summary>
|
|
/// <typeparam name="T"></typeparam>
|
|
/// <param name="expression"></param>
|
|
/// <param name="paths"></param>
|
|
/// <returns></returns>
|
|
T GetEntity<T>(Expression<Func<T, bool>> expression, BaseFilter fiter, params string[] paths) where T : MesEntityBase, new();
|
|
|
|
/// <summary>
|
|
/// 查询实体
|
|
/// </summary>
|
|
/// <typeparam name="T"></typeparam>
|
|
/// <param name="expression"></param>
|
|
/// <param name="paths"></param>
|
|
/// <returns></returns>
|
|
T GetEntity<T>(Expression<Func<T, bool>> expression, BaseFilter fiter, bool isTracking = false, params string[] paths) where T : MesEntityBase, new();
|
|
|
|
T GetEntityByRedis<T>(string key, Guid orgid)
|
|
where T : MesEntityBase, new();
|
|
|
|
T GetEntityByRedis<T>(Guid key, Guid orgid)
|
|
where T : MesEntityBase, new();
|
|
|
|
List<T> GetEntitiesByRedis<T>(BaseFilter filter) where T : MesEntityBase, new();
|
|
|
|
List<T> GetEntitiesByGroupRedis<T>(BaseFilter filter, string groupValue) where T : MesEntityBase, new();
|
|
|
|
|
|
List<T> GetEntitiesByRedis<T>(Expression<Func<T, bool>> expression, BaseFilter filter) where T : MesEntityBase, new();
|
|
|
|
List<T> GetEntitiesTableByRedis<T>(Expression<Func<T, bool>> expression, BaseFilter filter,
|
|
params string[] paths) where T : MesEntityBase, new();
|
|
|
|
List<T> GetEntitiesByRedis<T>(Expression<Func<T, bool>> expression, BaseFilter filter, string groupValue,
|
|
params string[] paths) where T : MesEntityBase, new();
|
|
|
|
PagedResultDto<T> GetOrderPageByRedis<T>(Expression<Func<T, bool>> expression, BasePageFilter pageFilter,
|
|
params string[] paths) where T : MesEntityBase, new();
|
|
|
|
IEnumerable<T> GetEntities<T>(Expression<Func<T, bool>> expression,
|
|
params string[] paths) where T : MesEntityBase, new();
|
|
IEnumerable<T> GetEntities<T>(Expression<Func<T, bool>> expression,
|
|
bool isTracking = false, params string[] paths) where T : MesEntityBase, new();
|
|
IEnumerable<T> GetEntities<T>(Expression<Func<T, bool>> expression, BaseFilter filter,
|
|
bool isTracking = false, params string[] paths) where T : MesEntityBase, new();
|
|
/// <summary>
|
|
/// 获取所有数据
|
|
/// </summary>
|
|
/// <typeparam name="T"></typeparam>
|
|
/// <param name="expression"></param>
|
|
/// <param name="filter"></param>
|
|
/// <param name="paths"></param>
|
|
/// <returns></returns>
|
|
IEnumerable<T> GetEntities<T>(Expression<Func<T, bool>> expression, BaseFilter filter, params string[] paths) where T : MesEntityBase, new();
|
|
/// <summary>
|
|
/// 获取所有数据
|
|
/// </summary>
|
|
/// <typeparam name="T">类型</typeparam>
|
|
/// <param name="orderBy">排序</param>
|
|
/// <param name="expression">lambd表达式</param>
|
|
/// <param name="filter">过滤器</param>
|
|
/// <param name="paths">需要关联查询的数据</param>
|
|
/// <returns></returns>
|
|
/// <summary>
|
|
/// 获取所有数据
|
|
/// </summary>
|
|
/// <typeparam name="T">类型</typeparam>
|
|
/// <param name="orderBy">排序</param>
|
|
/// <param name="expression">lambd表达式</param>
|
|
/// <param name="filter">过滤器</param>
|
|
/// <param name="paths">需要关联查询的数据</param>
|
|
/// <returns></returns>
|
|
IEnumerable<T> GetOrderEntities<T>(Expression<Func<T, bool>> expression,
|
|
BaseFilter filter, Action<IOrderable<T>> orderBy, params string[] paths) where T : MesEntityBase, new();
|
|
/// <summary>
|
|
/// 获取所有数据
|
|
/// </summary>
|
|
/// <typeparam name="T">类型</typeparam>
|
|
/// <param name="expression">lambd表达式</param>
|
|
/// <param name="filter">过滤器</param>
|
|
/// <param name="paths">需要关联查询的数据</param>
|
|
/// <returns></returns>
|
|
IEnumerable<T> GetOrderEntities<T>(Expression<Func<T, bool>> expression, BaseFilter filter, params string[] paths) where T : MesEntityBase, new();
|
|
/// <summary>
|
|
/// 排序获取数据
|
|
/// </summary>
|
|
/// <typeparam name="T"></typeparam>
|
|
/// <param name="expression"></param>
|
|
/// <param name="sort"></param>
|
|
/// <param name="order"></param>
|
|
/// <param name="filter"></param>
|
|
/// <param name="paths"></param>
|
|
/// <returns></returns>
|
|
IEnumerable<T> GetOrderEntities<T>(Expression<Func<T, bool>> expression, BaseFilter filter, string sort, string order, params string[] paths) where T : MesEntityBase, new();
|
|
/// <summary>
|
|
/// 排序获取数据
|
|
/// </summary>
|
|
/// <typeparam name="T"></typeparam>
|
|
/// <param name="expression"></param>
|
|
/// <param name="sort"></param>
|
|
/// <param name="order"></param>
|
|
/// <param name="filter"></param>
|
|
/// <param name="paths"></param>
|
|
/// <returns></returns>
|
|
IEnumerable<T> GetOrderEntities<T>(Expression<Func<T, bool>> expression, BaseFilter filter, Dictionary<string, string> orders, params string[] paths) where T : MesEntityBase, new();
|
|
|
|
IEnumerable<T> GetOrderEntities<T>(Expression<Func<T, bool>> expression, BaseFilter filter,
|
|
bool isTracking = false, params string[] paths) where T : MesEntityBase, new();
|
|
|
|
IEnumerable<T> GetOrderEntities<T>(Expression<Func<T, bool>> expression,
|
|
BaseFilter filter, Action<IOrderable<T>> orderBy, bool isTracking = false, params string[] paths) where T : MesEntityBase, new();
|
|
IEnumerable<T> GetOrderEntities<T>(Expression<Func<T, bool>> expression,
|
|
BaseFilter filter, Dictionary<string, string> orders, Action<IOrderable<T>> orderBy, bool isTracking = false, params string[] paths) where T : MesEntityBase, new();
|
|
|
|
PagedResultDto<T> GetPageEntities<T>(Expression<Func<T, bool>> expression, BasePageFilter pageFilter,
|
|
params string[] paths) where T : MesEntityBase, new();
|
|
|
|
IEnumerable<TreeNode<T>> GetTreeOrderEntities<T>(Expression<Func<T, bool>> expression, BaseFilter filter, bool isTracking,
|
|
params string[] paths) where T : TreeEntityBase<T>, new();
|
|
|
|
PagedResultDto<T> GetOrderPageEntities<T>(Expression<Func<T, bool>> expression, BasePageFilter pageFilter,
|
|
params string[] paths) where T : MesEntityBase, new();
|
|
|
|
PagedResultDto<T> GetOrderPageEntities<T>(Expression<Func<T, bool>> expression, BasePageFilter pageFilter,
|
|
int pageSize, int startIndex,
|
|
params string[] paths) where T : MesEntityBase, new();
|
|
PagedResultDto<T> GetOrderPageEntities<T>(Expression<Func<T, bool>> expression, BasePageFilter pageFilter,
|
|
int pageSize, int startIndex, bool isTracking = false,
|
|
params string[] paths) where T : MesEntityBase, new();
|
|
PagedResultDto<T> GetOrderPageEntities<T>(Expression<Func<T, bool>> expression, BasePageFilter pageFilter,
|
|
Dictionary<string, string> orders,
|
|
int pageSize, int startIndex, bool isTracking = false,
|
|
params string[] paths) where T : MesEntityBase, new();
|
|
|
|
IEnumerable<T> GetTree<T>(string id, bool containCurrent = true, BaseFilter filter = null,
|
|
params string[] paths) where T : TreeEntityBase<T>, new();
|
|
PagedResultDto<T> GetOrderPageEntities<T>(Expression<Func<T, bool>> expression, BasePageFilter pageFilter,
|
|
Dictionary<string, string> orders,
|
|
int pageSize, int startIndex, Action<IOrderable<T>> orderBy, bool isTracking = false,
|
|
params string[] paths) where T : MesEntityBase, new();
|
|
|
|
PagedResultDto<T> GetOrderPageEntities<T>(Expression<Func<T, bool>> expression, BasePageFilter pageFilter, string[] selectField,
|
|
params string[] paths) where T : MesEntityBase, new();
|
|
//
|
|
|
|
Task<PagedResultDto<T>> GetOrderPageEntitiesSync<T>(Expression<Func<T, bool>> expression, BasePageFilter pageFilter,
|
|
params string[] paths) where T : MesEntityBase, new();
|
|
|
|
Task<PagedResultDto<T>> GetOrderPageEntitiesSync<T>(Expression<Func<T, bool>> expression, BasePageFilter pageFilter,
|
|
int pageSize, int startIndex,
|
|
params string[] paths) where T : MesEntityBase, new();
|
|
Task<PagedResultDto<T>> GetOrderPageEntitiesSync<T>(Expression<Func<T, bool>> expression, BasePageFilter pageFilter,
|
|
int pageSize, int startIndex, bool isTracking = false,
|
|
params string[] paths) where T : MesEntityBase, new();
|
|
Task<PagedResultDto<T>> GetOrderPageEntitiesSync<T>(Expression<Func<T, bool>> expression, BasePageFilter pageFilter,
|
|
Dictionary<string, string> orders,
|
|
int pageSize, int startIndex, bool isTracking = false,
|
|
params string[] paths) where T : MesEntityBase, new();
|
|
Task<PagedResultDto<T>> GetOrderPageEntitiesSync<T>(Expression<Func<T, bool>> expression, BasePageFilter pageFilter,
|
|
Dictionary<string, string> orders,
|
|
int pageSize, int startIndex, Action<IOrderable<T>> orderBy, bool isTracking = false,
|
|
params string[] paths) where T : MesEntityBase, new();
|
|
|
|
int Count<T>(Expression<Func<T, bool>> expression, BaseFilter filter) where T : MesEntityBase, new();
|
|
bool IsAny<T>(Expression<Func<T, bool>> expression, BaseFilter filter) where T : MesEntityBase, new();
|
|
|
|
int Count<T>(Expression<Func<T, bool>> expression) where T : MesEntityBase, new();
|
|
#endregion
|
|
/// <summary>
|
|
/// 添加实体
|
|
/// </summary>
|
|
/// <param name="entity"></param>
|
|
/// <returns></returns>
|
|
bool AddEntity<T>(T entity) where T : MesEntityBase, new();
|
|
|
|
T AddAndGetEntity<T>(T entity) where T : MesEntityBase, new();
|
|
|
|
/// <summary>
|
|
/// 删除实体
|
|
/// </summary>
|
|
/// <param name="id"></param>
|
|
/// <returns></returns>
|
|
bool DeleteEntity<T>(Guid id) where T : MesEntityBase, new();
|
|
|
|
/// <summary>
|
|
/// 删除实体
|
|
/// </summary>
|
|
/// <param name="expression"></param>
|
|
/// <returns></returns>
|
|
bool DeleteEntity<T>(Expression<Func<T, bool>> expression) where T : MesEntityBase, new();
|
|
/// <summary>
|
|
/// 删除实体
|
|
/// </summary>
|
|
/// <param name="entity"></param>
|
|
/// <returns></returns>
|
|
bool DeleteEntity<T>(IEnumerable<T> entity) where T : MesEntityBase, new();
|
|
/// <summary>
|
|
/// 删除实体
|
|
/// </summary>
|
|
/// <typeparam name="T"></typeparam>
|
|
/// <param name="entity"></param>
|
|
/// <returns></returns>
|
|
bool DeleteEntity<T>(T entity) where T : MesEntityBase, new();
|
|
|
|
/// <summary>
|
|
/// 逻辑批量删除
|
|
/// </summary>
|
|
/// <typeparam name="T"></typeparam>
|
|
/// <param name="ids"></param>
|
|
/// <returns></returns>
|
|
bool BantchDeleteEntity<T>(List<Guid> ids) where T : MesEntityBase, new();
|
|
|
|
/// 更新实体
|
|
/// </summary>
|
|
/// <param name="entity"></param>
|
|
/// <returns></returns>
|
|
bool UpdateEntity<T>(T entity) where T : MesEntityBase, new();
|
|
|
|
/// <summary>
|
|
/// 按字段更新数据
|
|
/// </summary>
|
|
/// <typeparam name="T"></typeparam>
|
|
/// <param name="entity"></param>
|
|
/// <param name="updateField"></param>
|
|
/// <returns></returns>
|
|
bool UpdateEntity<T>(T entity, params string[] updateField) where T : MesEntityBase, new();
|
|
/// <summary>
|
|
///根据字段批量更新实体
|
|
/// </summary>
|
|
/// <typeparam name="T"></typeparam>
|
|
/// <param name="entities"></param>
|
|
/// <param name="updateField"></param>
|
|
/// <returns></returns>
|
|
bool BantchUpdateEntity<T>(IEnumerable<T> entities, params string[] updateField) where T : MesEntityBase, new();
|
|
/// <summary>
|
|
/// 批量添加实体
|
|
/// </summary>
|
|
/// <param name="entities">实体集合</param>
|
|
/// <returns></returns>
|
|
bool BantchAddEntity<T>(IEnumerable<T> entities) where T : MesEntityBase, new();
|
|
|
|
/// <summary>
|
|
/// 批量更新实体
|
|
/// </summary>
|
|
/// <param name="entities">实体集</param>
|
|
/// <returns></returns>
|
|
bool BantchUpdateEntity<T>(IEnumerable<T> entities) where T : MesEntityBase, new();
|
|
/// <summary>
|
|
/// 批量保存实体
|
|
/// </summary>
|
|
/// <param name="entities">批量保存</param>
|
|
/// <returns></returns>
|
|
bool BantchSaveEntity<T>(IEnumerable<T> entities) where T : MesEntityBase, new();
|
|
|
|
|
|
|
|
#region 树实体
|
|
/// <summary>
|
|
/// 添加实体
|
|
/// </summary>
|
|
/// <param name="entity"></param>
|
|
/// <returns></returns>
|
|
bool TreeAddEntity<T>(T entity) where T : TreeEntityBase<T>, new();
|
|
T TreeAddAndGetEntity<T>(T entity) where T : MesEntityBase, new();
|
|
/// <summary>
|
|
/// 删除实体
|
|
/// </summary>
|
|
/// <param name="id"></param>
|
|
/// <returns></returns>
|
|
bool TreeDeleteEntity<T>(Guid id) where T : TreeEntityBase<T>, new();
|
|
|
|
/// <summary>
|
|
/// 删除实体
|
|
/// </summary>
|
|
/// <param name="expression"></param>
|
|
/// <returns></returns>
|
|
bool TreeDeleteEntity<T>(Expression<Func<T, bool>> expression) where T : TreeEntityBase<T>, new();
|
|
/// <summary>
|
|
/// 删除实体
|
|
/// </summary>
|
|
/// <param name="entity"></param>
|
|
/// <returns></returns>
|
|
bool TreeDeleteEntity<T>(IEnumerable<T> entity) where T : TreeEntityBase<T>, new();
|
|
/// <summary>
|
|
/// 删除实体
|
|
/// </summary>
|
|
/// <typeparam name="T"></typeparam>
|
|
/// <param name="entity"></param>
|
|
/// <returns></returns>
|
|
bool TreeDeleteEntity<T>(T entity) where T : TreeEntityBase<T>, new();
|
|
|
|
/// <summary>
|
|
/// 逻辑批量删除
|
|
/// </summary>
|
|
/// <typeparam name="T"></typeparam>
|
|
/// <param name="ids"></param>
|
|
/// <returns></returns>
|
|
bool TreeBantchDeleteEntity<T>(List<Guid> ids) where T : TreeEntityBase<T>, new();
|
|
|
|
|
|
/// <summary>
|
|
/// 更新实体
|
|
/// </summary>
|
|
/// <param name="entity"></param>
|
|
/// <returns></returns>
|
|
bool TreeUpdateEntity<T>(T entity) where T : TreeEntityBase<T>, new();
|
|
|
|
/// <summary>
|
|
/// 批量添加实体
|
|
/// </summary>
|
|
/// <param name="entities">实体集合</param>
|
|
/// <returns></returns>
|
|
bool TreeBantchAddEntity<T>(IEnumerable<T> entities) where T : TreeEntityBase<T>, new();
|
|
|
|
/// <summary>
|
|
/// 批量更新实体
|
|
/// </summary>
|
|
/// <param name="entities">实体集</param>
|
|
/// <returns></returns>
|
|
bool TreeBantchUpdateEntity<T>(IEnumerable<T> entities) where T : TreeEntityBase<T>, new();
|
|
/// <summary>
|
|
/// 批量保存实体
|
|
/// </summary>
|
|
/// <param name="entities">批量保存</param>
|
|
/// <returns></returns>
|
|
bool TreeBantchSaveEntity<T>(IEnumerable<T> entities) where T : TreeEntityBase<T>, new();
|
|
|
|
/// <summary>
|
|
/// 批量添加实体
|
|
/// </summary>
|
|
/// <param name="entities">实体集合</param>
|
|
/// <returns></returns>
|
|
public bool TreeBantchAddEntityNoCommit<T>(IEnumerable<T> entities) where T : TreeEntityBase<T>, new()
|
|
{
|
|
return this.BantchAddEntityNoCommit<T>(entities);
|
|
|
|
}
|
|
/// <summary>
|
|
/// 添加实体
|
|
/// </summary>
|
|
/// <param name="entity"></param>
|
|
/// <returns></returns>
|
|
public bool TreeAddEntityNoCommit<T>(T entity) where T : TreeEntityBase<T>, new()
|
|
{
|
|
return this.AddEntityNoCommit<T>(entity);
|
|
}
|
|
|
|
public T TreeAddAndGetEntityNoCommit<T>(T entity) where T : MesEntityBase, new()
|
|
{
|
|
return this.AddAndGetEntityNoCommit<T>(entity);
|
|
}
|
|
T AddAndGetEntityNoCommit<T>(T entity) where T : MesEntityBase, new();
|
|
/// <summary>
|
|
/// 删除实体
|
|
/// </summary>
|
|
/// <param name="id"></param>
|
|
/// <returns></returns>
|
|
bool TreeDeleteEntityNoCommit<T>(Guid id) where T : TreeEntityBase<T>, new();
|
|
|
|
|
|
/// <summary>
|
|
/// 删除实体
|
|
/// </summary>
|
|
/// <param name="expression"></param>
|
|
/// <returns></returns>
|
|
bool TreeDeleteEntityNoCommit<T>(Expression<Func<T, bool>> expression) where T : TreeEntityBase<T>, new();
|
|
/// <summary>
|
|
/// 删除实体
|
|
/// </summary>
|
|
/// <param name="entity"></param>
|
|
/// <returns></returns>
|
|
bool TreeDeleteEntityNoCommit<T>(IEnumerable<T> entity) where T : TreeEntityBase<T>, new();
|
|
/// <summary>
|
|
/// 删除实体
|
|
/// </summary>
|
|
/// <typeparam name="T"></typeparam>
|
|
/// <param name="entity"></param>
|
|
/// <returns></returns>
|
|
bool TreeDeleteEntityNoCommit<T>(T entity) where T : TreeEntityBase<T>, new();
|
|
|
|
/// <summary>
|
|
/// 逻辑批量删除
|
|
/// </summary>
|
|
/// <typeparam name="T"></typeparam>
|
|
/// <param name="ids"></param>
|
|
/// <returns></returns>
|
|
bool TreeBantchDeleteEntityNoCommit<T>(List<Guid> ids) where T : TreeEntityBase<T>, new();
|
|
/// <summary>
|
|
/// 更新实体
|
|
/// </summary>
|
|
/// <param name="entity"></param>
|
|
/// <returns></returns>
|
|
bool TreeUpdateEntityNoCommit<T>(T entity) where T : TreeEntityBase<T>, new();
|
|
|
|
/// <summary>
|
|
/// 批量更新实体
|
|
/// </summary>
|
|
/// <param name="entities">实体集</param>
|
|
/// <returns></returns>
|
|
bool TreeBantchUpdateEntityNoCommit<T>(IEnumerable<T> entities) where T : TreeEntityBase<T>, new();
|
|
/// <summary>
|
|
/// 批量保存实体
|
|
/// </summary>
|
|
/// <param name="entities">批量保存</param>
|
|
/// <returns></returns>
|
|
bool TreeBantchSaveEntityNoCommit<T>(IEnumerable<T> entities) where T : TreeEntityBase<T>, new();
|
|
#endregion
|
|
|
|
T AddAndGetEntity_noneBase<T>(T entity) where T : class;
|
|
|
|
void AddEntities_noneBase<T>(IEnumerable<T> entities) where T : class;
|
|
|
|
void UpdateEntities_noneBase<T>(IEnumerable<T> entities) where T : class;
|
|
|
|
T GetEntity_noneBase<T>(Expression<Func<T, bool>> expressions) where T : class;
|
|
|
|
List<T> GetEntities_noneBase<T>(Expression<Func<T, bool>> expressions) where T : class;
|
|
|
|
bool DeleteEntity_noneBase<T>(Expression<Func<T, bool>> expression) where T : class;
|
|
|
|
bool AddEntityNoCommit<T>(T entity) where T : MesEntityBase, new();
|
|
|
|
bool BantchAddEntityNoCommit<T>(IEnumerable<T> entities) where T : MesEntityBase, new();
|
|
/// <summary>
|
|
/// 逻辑删除
|
|
/// </summary>
|
|
/// <param name="id"></param>
|
|
/// <returns></returns>
|
|
bool DeleteEntityNoCommit<T>(Guid id) where T : MesEntityBase, new();
|
|
/// <summary>
|
|
/// 逻辑删除
|
|
/// </summary>
|
|
/// <param name="key"></param>
|
|
/// <returns></returns>
|
|
bool DeleteEntityNoCommit<T>(Expression<Func<T, bool>> predicate) where T : MesEntityBase, new();
|
|
/// <summary>
|
|
/// 逻辑删除
|
|
/// </summary>
|
|
/// <param name="key"></param>
|
|
/// <returns></returns>
|
|
bool DeleteEntityNoCommit<T>(IEnumerable<T> entities) where T : MesEntityBase, new();
|
|
/// <summary>
|
|
/// 逻辑批量删除
|
|
/// </summary>
|
|
/// <typeparam name="T"></typeparam>
|
|
/// <param name="ids"></param>
|
|
/// <returns></returns>
|
|
bool BantchDeleteEntityNoCommit<T>(List<Guid> ids) where T : MesEntityBase, new();
|
|
/// <summary>
|
|
/// 逻辑删除
|
|
/// </summary>
|
|
/// <param name="key"></param>
|
|
/// <returns></returns>
|
|
bool DeleteEntityNoCommit<T>(T entity) where T : MesEntityBase, new();
|
|
/// <summary>
|
|
/// 更新
|
|
/// </summary>
|
|
/// <param name="entity">实体</param>
|
|
/// <returns>是否成功</returns>
|
|
bool UpdateEntityNoCommit<T>(T entity) where T : MesEntityBase, new();
|
|
/// <summary>
|
|
/// 批量更新
|
|
/// </summary>
|
|
/// <param name="entities">实体集合</param>
|
|
/// <returns>是否成功</returns>
|
|
bool BantchUpdateEntityNoCommit<T>(IEnumerable<T> entities) where T : MesEntityBase, new();
|
|
/// <summary>
|
|
/// 更新
|
|
/// </summary>
|
|
/// <param name="entity">实体</param>
|
|
/// <returns>是否成功</returns>
|
|
bool UpdateEntityNoCommit<T>(T entity, params string[] updateField) where T : MesEntityBase, new();
|
|
/// <summary>
|
|
/// 批量更新
|
|
/// </summary>
|
|
/// <param name="entities">实体集合</param>
|
|
/// <returns>是否成功</returns>
|
|
bool BantchUpdateEntityNoCommit<T>(IEnumerable<T> entities, params string[] updateField) where T : MesEntityBase, new();
|
|
/// <summary>
|
|
/// 批量更新(新增和保存一起)速度慢
|
|
/// </summary>
|
|
/// <param name="entities">实体集合</param>
|
|
/// <returns>是否成功</returns>
|
|
bool BantchSaveEntityNoCommit<T>(IEnumerable<T> entities) where T : MesEntityBase, new();
|
|
/// <summary>
|
|
/// 统一提交
|
|
/// </summary>
|
|
/// <param name="comitAction">数据库方法</param>
|
|
void UnifiedCommit(Action comitAction);
|
|
|
|
#region 根据Db连接提交
|
|
|
|
void AddEntityByConn<T>(T entity, string conn) where T : MesEntityBase, new();
|
|
|
|
void UpdateEntitiesByConn<T>(IEnumerable<T> entities, string conn) where T : MesEntityBase, new();
|
|
|
|
void UpdateEntityByConn<T>(T entity, string conn, params string[] updateField) where T : MesEntityBase, new();
|
|
|
|
void DeleteEntityByConn<T>(Expression<Func<T, bool>> expression, string conn) where T : MesEntityBase, new();
|
|
|
|
void DeleteEntityByConn<T>(T entity, string conn) where T : MesEntityBase, new();
|
|
void DeleteEntityByConn<T>(Guid id, string conn) where T : MesEntityBase, new();
|
|
void DeleteEntitiesByConn<T>(IEnumerable<T> entities, string conn) where T : MesEntityBase, new();
|
|
void AddEntitiesByConn<T>(IEnumerable<T> entities, string conn) where T : MesEntityBase, new();
|
|
void UpdateEntitiesByConn<T>(IEnumerable<T> entities, string conn, params string[] updateField) where T : MesEntityBase, new();
|
|
|
|
#endregion
|
|
|
|
#region 根据租户提交
|
|
void AddEntityByTenant<T>(T entity, string Tenant) where T : MesEntityBase, new();
|
|
|
|
void UpdateEntitiesByTenant<T>(IEnumerable<T> entities, string Tenant) where T : MesEntityBase, new();
|
|
|
|
void UpdateEntityByTenant<T>(T entity, string Tenant, params string[] updateField) where T : MesEntityBase, new();
|
|
|
|
void DeleteEntityByTenant<T>(Expression<Func<T, bool>> expression, string Tenant) where T : MesEntityBase, new();
|
|
|
|
void DeleteEntityByTenant<T>(T entity, string Tenant) where T : MesEntityBase, new();
|
|
void DeleteEntityByTenant<T>(Guid id, string Tenant) where T : MesEntityBase, new();
|
|
void DeleteEntitiesByTenant<T>(IEnumerable<T> entities, string Tenant) where T : MesEntityBase, new();
|
|
void AddEntitiesByTenant<T>(IEnumerable<T> entities, string Tenant) where T : MesEntityBase, new();
|
|
void UpdateEntitiesByTenant<T>(IEnumerable<T> entities, string Tenant, params string[] updateField) where T : MesEntityBase, new();
|
|
|
|
#endregion
|
|
|
|
|
|
}
|
|
|
|
}
|