You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.3 KiB
43 lines
1.3 KiB
using Serilog;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Linq.Expressions;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using TaskManager.Entity;
|
|
using TaskManager.EntityFramework.Repository;
|
|
using Wood.Util.Filters;
|
|
using Z.BulkOperations;
|
|
|
|
namespace TaskManager.EntityFramework
|
|
{
|
|
public interface IRepository<TEntity> where TEntity : BaseEntity
|
|
{
|
|
Task<TEntity> GetByIdAsync(long id);
|
|
Task<IEnumerable<TEntity>> GetAllAsync();
|
|
Task<TEntity> AddAsync(TEntity entity);
|
|
Task UpdateAsync(TEntity entity);
|
|
Task DeleteAsync(long id);
|
|
|
|
/// <summary>
|
|
/// 批量合拼
|
|
/// </summary>
|
|
/// <param name="entities"></param>
|
|
/// <returns></returns>
|
|
Task BlukMergeAsync(List<TEntity> entities, Action<BulkOperation<TEntity>> action);
|
|
|
|
Task BlukInsertAsync(List<TEntity> entities, Action<BulkOperation<TEntity>> action);
|
|
Task<PagedResult<TEntity>> GetPagedAsync(PagingParams pagingParams);
|
|
|
|
|
|
Task<PagedResult<TEntity>> GetPagedAsync(
|
|
Expression<Func<TEntity, bool>> filter = null,
|
|
PagingParams pagingParams = null);
|
|
|
|
Task<PagedResult<TEntity>> GetDataPagedAsync(
|
|
Expression<Func<TEntity, bool>> filter = null,
|
|
PagingParams pagingParams = null,Condition condition = null);
|
|
|
|
}
|
|
}
|