25 lines
923 B
C#
25 lines
923 B
C#
using System.Linq.Expressions;
|
|
|
|
namespace DigitalData.Core.Abstraction.Application.Repository;
|
|
|
|
public interface IRepository<TEntity>
|
|
{
|
|
public IEntityMapper<TEntity> Mapper { get; }
|
|
|
|
public Task<TEntity> CreateAsync(TEntity entity, CancellationToken cancel = default);
|
|
|
|
public Task<IEnumerable<TEntity>> CreateAsync(IEnumerable<TEntity> entities, CancellationToken cancel = default);
|
|
|
|
public IQueryable<TEntity> Read();
|
|
|
|
public IQueryable<TEntity> ReadOnly();
|
|
|
|
public Task UpdateAsync<TDto>(TDto dto, Expression<Func<TEntity, bool>> expression, CancellationToken cancel = default);
|
|
|
|
public Task UpdateAsync<TDto>(TDto dto, IQueryable<TEntity> query, CancellationToken cancel = default);
|
|
|
|
public Task DeleteAsync(Expression<Func<TEntity, bool>> expression, CancellationToken cancel = default);
|
|
|
|
public Task DeleteAsync(IQueryable<TEntity> query, CancellationToken cancel = default);
|
|
}
|