Added support for updating and deleting Catalog records via SQL Server stored procedures. Introduced PUT /catalogs/sp and DELETE /catalogs/sp/{id} endpoints in CatalogsController. Extended service and repository interfaces and implementations to handle stored procedure operations. Added Microsoft.Data.SqlClient package for direct SQL execution. Repository checks for record existence before SP calls to prevent unintended behavior.
13 lines
754 B
C#
13 lines
754 B
C#
namespace DbFirst.Application.Catalogs;
|
|
|
|
public interface ICatalogService
|
|
{
|
|
Task<List<CatalogDto>> GetAllAsync(CancellationToken cancellationToken = default);
|
|
Task<CatalogDto?> GetByIdAsync(int id, CancellationToken cancellationToken = default);
|
|
Task<CatalogDto> CreateAsync(CatalogDto dto, CancellationToken cancellationToken = default);
|
|
Task<bool> UpdateAsync(int id, CatalogDto dto, CancellationToken cancellationToken = default);
|
|
Task<CatalogDto?> UpdateWithStoredProcedureAsync(CatalogDto dto, CancellationToken cancellationToken = default);
|
|
Task<bool> DeleteAsync(int id, CancellationToken cancellationToken = default);
|
|
Task<bool> DeleteWithStoredProcedureAsync(int id, CancellationToken cancellationToken = default);
|
|
}
|