30 lines
No EOL
682 B
C#
30 lines
No EOL
682 B
C#
using System.Net.Http.Json;
|
|
|
|
namespace Books.DataLoading;
|
|
|
|
public sealed class WebDataLoader(string endpointUrl, IHttpClientFactory httpClientFactory) : LoaderBase
|
|
{
|
|
private readonly HttpClient? _httpClient = httpClientFactory.CreateClient();
|
|
|
|
public override ValueTask DisposeAsync()
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public override async ValueTask LoadAsync()
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|
|
|
|
// TODO WebProcessingException
|
|
|
|
public interface IHttpClientFactory
|
|
{
|
|
public HttpClient CreateClient();
|
|
}
|
|
|
|
public sealed class HttpClientFactory : IHttpClientFactory
|
|
{
|
|
public HttpClient CreateClient() => new();
|
|
} |