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:
OlgunR
2026-01-14 15:29:09 +01:00
parent 6caf3a4c07
commit a849a88fa3
5 changed files with 47 additions and 83 deletions

View File

@@ -6,9 +6,8 @@ public interface ICatalogRepository
{
Task<List<VwmyCatalog>> GetAllAsync(CancellationToken cancellationToken = default);
Task<VwmyCatalog?> GetByIdAsync(int id, CancellationToken cancellationToken = default);
Task<VwmyCatalog> AddAsync(VwmyCatalog catalog, CancellationToken cancellationToken = default);
Task<bool> UpdateAsync(int id, VwmyCatalog catalog, CancellationToken cancellationToken = default);
Task<VwmyCatalog?> UpdateWithStoredProcedureAsync(VwmyCatalog catalog, CancellationToken cancellationToken = default);
Task<VwmyCatalog> InsertAsync(VwmyCatalog catalog, CancellationToken cancellationToken = default);
Task<VwmyCatalog?> UpdateAsync(int id, VwmyCatalog catalog, CancellationToken cancellationToken = default);
Task<VwmyCatalog?> UpsertAsync(VwmyCatalog catalog, CancellationToken cancellationToken = default);
Task<bool> DeleteAsync(int id, CancellationToken cancellationToken = default);
Task<bool> DeleteWithStoredProcedureAsync(int id, CancellationToken cancellationToken = default);
}