Refactor Catalog update/upsert endpoints and service logic
- Update endpoint now returns CatalogReadDto or NotFound - Replace UpdateWithStoredProcedure with Upsert endpoint (PUT /upsert) - Rename AddAsync to InsertAsync; UpdateAsync returns DTO or null - Introduce UpsertAsync for combined insert/update logic - Remove stored procedure-specific update/delete methods - Use DTOs consistently in controller/service responses - Repository methods now return entities instead of booleans
This commit is contained in:
@@ -5,8 +5,7 @@ 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<bool> UpdateAsync(int id, CatalogWriteDto dto, CancellationToken cancellationToken = default);
|
||||
Task<CatalogReadDto?> UpdateWithStoredProcedureAsync(int id, CatalogWriteDto dto, CancellationToken cancellationToken = default);
|
||||
Task<CatalogReadDto?> UpdateAsync(int id, CatalogWriteDto dto, CancellationToken cancellationToken = default);
|
||||
Task<CatalogReadDto?> UpsertAsync(CatalogWriteDto dto, CancellationToken cancellationToken = default);
|
||||
Task<bool> DeleteAsync(int id, CancellationToken cancellationToken = default);
|
||||
Task<bool> DeleteWithStoredProcedureAsync(int id, CancellationToken cancellationToken = default);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user