Remove Upsert functionality from Catalog API

Removed Upsert endpoint and related service/repository methods. Deleted ExecuteUpsertAsync helper. Insert now throws NotImplementedException as a placeholder. Refactored Delete method in repository; logic unchanged.
This commit is contained in:
OlgunR
2026-01-15 16:57:33 +01:00
parent a849a88fa3
commit facc376f74
5 changed files with 20 additions and 62 deletions

View File

@@ -58,21 +58,6 @@ public class CatalogService : ICatalogService
return updated == null ? null : _mapper.Map<CatalogReadDto>(updated);
}
public async Task<CatalogReadDto?> UpsertAsync(CatalogWriteDto dto, CancellationToken cancellationToken = default)
{
var entity = _mapper.Map<VwmyCatalog>(dto);
if (entity.Guid == 0)
{
entity.AddedWho = "system";
entity.AddedWhen = DateTime.UtcNow;
}
entity.ChangedWho = "system";
entity.ChangedWhen = DateTime.UtcNow;
var upserted = await _repository.UpsertAsync(entity, cancellationToken);
return upserted == null ? null : _mapper.Map<CatalogReadDto>(upserted);
}
public async Task<bool> DeleteAsync(int id, CancellationToken cancellationToken = default)
{
return await _repository.DeleteAsync(id, cancellationToken);