started moving api layer to shared abstract class

This commit is contained in:
2021-10-20 16:22:49 -04:00
parent c91a7cf7e2
commit 5b46e2fb15
10 changed files with 90 additions and 18 deletions

18
Shared/APIService.cs Normal file
View File

@@ -0,0 +1,18 @@
using System.Net.Http;
using Microsoft.Extensions.Logging;
namespace Shared
{
public abstract class APIService
{
protected ILogger Logger { get; set; }
protected HttpClient Client { get; set; }
protected APIService(ILogger logger, HttpClient httpClient)
{
Logger = logger;
Client = httpClient ?? new HttpClient();
}
}
}

11
Shared/Shared.csproj Normal file
View File

@@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging" Version="5.0.0" />
</ItemGroup>
</Project>