Introduce interfaces for all API clients and update dependency injection to use these interfaces. Refactor services and components to depend on abstractions instead of concrete implementations, improving testability and maintainability.
12 lines
399 B
C#
12 lines
399 B
C#
using DbFirst.BlazorWebApp.Models;
|
|
|
|
namespace DbFirst.BlazorWebApp.Services;
|
|
|
|
public interface ICatalogApiClient
|
|
{
|
|
Task<List<CatalogReadDto>> GetAllAsync();
|
|
Task<CatalogReadDto?> GetByIdAsync(int id);
|
|
Task<ApiResult<CatalogReadDto?>> CreateAsync(CatalogWriteDto dto);
|
|
Task<ApiResult<bool>> UpdateAsync(int id, CatalogWriteDto dto);
|
|
Task<ApiResult<bool>> DeleteAsync(int id);
|
|
} |