started moving api layer to shared abstract class
This commit is contained in:
18
Shared/APIService.cs
Normal file
18
Shared/APIService.cs
Normal 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
11
Shared/Shared.csproj
Normal 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>
|
||||
Reference in New Issue
Block a user