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.
14 lines
691 B
C#
14 lines
691 B
C#
using DbFirst.Domain.Entities;
|
|
|
|
namespace DbFirst.Domain.Repositories;
|
|
|
|
public interface ICatalogRepository
|
|
{
|
|
Task<List<VwmyCatalog>> GetAllAsync(CancellationToken cancellationToken = default);
|
|
Task<VwmyCatalog?> GetByIdAsync(int id, CancellationToken cancellationToken = default);
|
|
Task<VwmyCatalog?> GetByTitleAsync(string title, 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);
|
|
}
|