Move ApiResult<T> to ApiResult.cs with proper namespace
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.
This commit is contained in:
@@ -61,11 +61,4 @@ public class CatalogApiClient
|
||||
var error = await ApiClientHelper.ReadErrorAsync(response);
|
||||
return ApiResult<bool>.Fail(error);
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user