ApiResult<T> and its static methods were relocated from CatalogApiClient.cs to a new ApiResult.cs file. The new file now includes the DbFirst.BlazorWebApp.Models namespace for better code organization.
7 lines
265 B
C#
7 lines
265 B
C#
namespace DbFirst.BlazorWebApp.Models;
|
|
|
|
public record ApiResult<T>(bool Success, T? Value, string? Error)
|
|
{
|
|
public static ApiResult<T> Ok(T? value) => new(true, value, null);
|
|
public static ApiResult<T> Fail(string? error) => new(false, default, error);
|
|
} |