Add SP-based update/delete for Catalogs, new endpoints
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.
This commit is contained in:
@@ -8,5 +8,7 @@ public interface ICatalogRepository
|
||||
Task<Catalog?> GetByIdAsync(int id, CancellationToken cancellationToken = default);
|
||||
Task<Catalog> AddAsync(Catalog catalog, CancellationToken cancellationToken = default);
|
||||
Task<bool> UpdateAsync(int id, Catalog catalog, CancellationToken cancellationToken = default);
|
||||
Task<Catalog?> UpdateWithStoredProcedureAsync(Catalog catalog, 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