Added a uniqueness check for catalog titles in the creation flow. The service now prevents creating catalogs with duplicate titles by checking for existing entries before insertion. If a duplicate is detected, the API returns a 409 Conflict response. Updated interfaces and repository to support title-based lookups.
11 lines
569 B
C#
11 lines
569 B
C#
namespace DbFirst.Application.Catalogs;
|
|
|
|
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);
|
|
}
|