Skip to content

Commit

Permalink
Mark methods using IFilterSets as obsolete
Browse files Browse the repository at this point in the history
  • Loading branch information
YuriyDurov committed Jul 2, 2024
1 parent 94d3530 commit b73c641
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/BitzArt.CA.Core/Interfaces/IRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,34 @@ public interface IRepository<TEntity> : IRepository
where TEntity : class
{
public void Add(TEntity entity);

public void AddRange(IEnumerable<TEntity> entities);

public void Remove(TEntity entity);

public void RemoveRange(IEnumerable<TEntity> entities);

[Obsolete("Use an overload with Func<IQueryable<TEntity>, IQueryable<TResult>> instead")]
public Task<IEnumerable<TEntity>> GetAllAsync(IFilterSet<TEntity>? filter = null, CancellationToken cancellationToken = default);
public Task<IEnumerable<TResult>> GetAllAsync<TResult>(Func<IQueryable<TEntity>, IQueryable<TResult>> filter, CancellationToken cancellationToken = default);

[Obsolete("Use an overload with Func<IQueryable<TEntity>, IQueryable<TResult>> instead")]
public Task<PageResult<TEntity>> GetPageAsync(PageRequest pageRequest, IFilterSet<TEntity>? filter = null, CancellationToken cancellationToken = default);
public Task<PageResult<TResult>> GetPageAsync<TResult>(PageRequest pageRequest, Func<IQueryable<TEntity>, IQueryable<TResult>> filter, CancellationToken cancellationToken = default);

[Obsolete("Use an overload with Func<IQueryable<TEntity>, IQueryable<TResult>> instead")]
public Task<TEntity?> GetAsync(IFilterSet<TEntity> filter, CancellationToken cancellationToken = default);
public Task<TResult?> GetAsync<TResult>(Func<IQueryable<TEntity>, IQueryable<TResult>> filter, CancellationToken cancellationToken = default);

[Obsolete("Use an overload with Func<IQueryable<TEntity>, IQueryable<TResult>> instead")]
public Task<int> CountAsync(IFilterSet<TEntity>? filter = null, CancellationToken cancellationToken = default);
public Task<int> CountAsync<TResult>(Func<IQueryable<TEntity>, IQueryable<TResult>> filter, CancellationToken cancellationToken = default);

[Obsolete("Use an overload with Func<IQueryable<TEntity>, IQueryable<TResult>> instead")]
public Task<long> LongCountAsync(IFilterSet<TEntity>? filter = null, CancellationToken cancellationToken = default);
public Task<long> LongCountAsync<TResult>(Func<IQueryable<TEntity>, IQueryable<TResult>> filter, CancellationToken cancellationToken = default);

[Obsolete("Use an overload with Func<IQueryable<TEntity>, IQueryable<TResult>> instead")]
public Task<bool> AnyAsync(IFilterSet<TEntity>? filter = null, CancellationToken cancellationToken = default);
public Task<bool> AnyAsync<TResult>(Func<IQueryable<TEntity>, IQueryable<TResult>> filter, CancellationToken cancellationToken = default);
}

0 comments on commit b73c641

Please sign in to comment.