All API client interfaces and implementations now accept an optional CancellationToken parameter for each method. This enables consumers to cancel HTTP requests, improving responsiveness and resource management. No changes were made to core logic or return types; only method signatures and HttpClient calls were updated to support cancellation.
12 lines
557 B
C#
12 lines
557 B
C#
using DbFirst.BlazorWebApp.Models;
|
|
|
|
namespace DbFirst.BlazorWebApp.Services;
|
|
|
|
public interface ICatalogApiClient
|
|
{
|
|
Task<List<CatalogReadDto>> GetAllAsync(CancellationToken ct = default);
|
|
Task<CatalogReadDto?> GetByIdAsync(int id, CancellationToken ct = default);
|
|
Task<ApiResult<CatalogReadDto?>> CreateAsync(CatalogWriteDto dto, CancellationToken ct = default);
|
|
Task<ApiResult<bool>> UpdateAsync(int id, CatalogWriteDto dto, CancellationToken ct = default);
|
|
Task<ApiResult<bool>> DeleteAsync(int id, CancellationToken ct = default);
|
|
} |