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.
26 lines
1.0 KiB
26 lines
1.0 KiB
using System.Linq.Expressions;
|
|
using Infrastructure.Base;
|
|
using Shared;
|
|
|
|
namespace Infrastructure;
|
|
|
|
public interface IRepository<T> where T : EntityBase
|
|
{
|
|
IEnumerable<T> GetAll(params Expression<Func<T, object>>[] includes);
|
|
|
|
Task<IEnumerable<T>> GetAllAsync(Expression<Func<T, bool>>? expression = null, CancellationToken cancellationToken = default, params Expression<Func<T, object>>[] includes);
|
|
|
|
Task<T?> GetByIdAsync(object id, params Expression<Func<T, object>>[] includes);
|
|
|
|
Task InsertAsync(T obj);
|
|
|
|
void Update(T obj);
|
|
|
|
void Delete(object id);
|
|
|
|
Task<PaginatedResult<T>> GetPaginatedListAsync(int pageNumber, int pageSize, string[]? orderBy = null, Expression<Func<T, bool>>? expression = null, CancellationToken cancellationToken = default, params Expression<Func<T, object>>[] includes);
|
|
|
|
Task<int> CountAsync(Expression<Func<T, bool>>? expression = null, CancellationToken cancellationToken = default);
|
|
|
|
Task<bool> ExistsAsync(Expression<Func<T, bool>> expression, CancellationToken cancellationToken = default);
|
|
} |