-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Just as suggestion, have you considered moving repeated implementation logic code into their interfaces by taking advantage of default interface methods?
For example, the following overrides could be removed from:
https://github.com/RCommon-Team/RCommon/blob/main/Src/RCommon.Linq2Db/Crud/Linq2DbRepository.cs
public override IQueryable<TEntity> FindQuery(ISpecification<TEntity> specification)
{
... // Logic moved into ILinqRepository.cs
}
public async override Task<IPaginatedList<TEntity>> FindAsync(IPagedSpecification<TEntity> specification, CancellationToken token = default)
{
... // Logic moved into ILinqRepository.cs
}
and moved into:
https://github.com/RCommon-Team/RCommon/blob/main/Src/RCommon.Persistence/Crud/ILinqRepository.cs
public interface ILinqRepository<TEntity> : IQueryable<TEntity>, IReadOnlyRepository<TEntity>, IWriteOnlyRepository<TEntity>,
IEagerLoadableQueryable<TEntity>
where TEntity : IBusinessEntity
{
...
IQueryable<TEntity> FindQuery(ISpecification<TEntity> specification)
=> FindQuery(specification.Predicate);
Task<IPaginatedList<TEntity>> FindAsync(IPagedSpecification<TEntity> specification, CancellationToken token = default)
=> FindAsync(specification.Predicate, specification.OrderByExpression, specification.OrderByAscending, specification.PageIndex, specification.PageSize, token);
...
}
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request