Added TODO comments in Program.cs for exception handling middleware, and in CatalogService.cs and ICatalogService.cs for creating a generic service and implementing CQRS with MediatR. No functional changes made.
12 lines
626 B
C#
12 lines
626 B
C#
namespace DbFirst.Application.Catalogs;
|
|
|
|
//TODO: create generic service to reduce code duplication
|
|
public interface ICatalogService
|
|
{
|
|
Task<List<CatalogReadDto>> GetAllAsync(CancellationToken cancellationToken = default);
|
|
Task<CatalogReadDto?> GetByIdAsync(int id, CancellationToken cancellationToken = default);
|
|
Task<CatalogReadDto> CreateAsync(CatalogWriteDto dto, CancellationToken cancellationToken = default);
|
|
Task<CatalogReadDto?> UpdateAsync(int id, CatalogWriteDto dto, CancellationToken cancellationToken = default);
|
|
Task<bool> DeleteAsync(int id, CancellationToken cancellationToken = default);
|
|
}
|