Added TODO comments in ICatalogRepository and CatalogRepository to suggest adopting a generic repository pattern to reduce code duplication. Also noted the potential move of the interface to the application layer for better adherence to clean architecture principles.
15 lines
798 B
C#
15 lines
798 B
C#
using DbFirst.Domain.Entities;
|
|
|
|
namespace DbFirst.Domain.Repositories;
|
|
|
|
// TODO: instead of creating interface per entity, consider using generic repository pattern (eg. IRepository<T>) to reduce code duplication.
|
|
//TODO: move to application layer as a part of clean architecture
|
|
public interface ICatalogRepository
|
|
{
|
|
Task<List<VwmyCatalog>> GetAllAsync(CancellationToken cancellationToken = default);
|
|
Task<VwmyCatalog?> GetByIdAsync(int id, CancellationToken cancellationToken = default);
|
|
Task<VwmyCatalog> InsertAsync(VwmyCatalog catalog, CancellationToken cancellationToken = default);
|
|
Task<VwmyCatalog?> UpdateAsync(int id, VwmyCatalog catalog, CancellationToken cancellationToken = default);
|
|
Task<bool> DeleteAsync(int id, CancellationToken cancellationToken = default);
|
|
}
|