Updating - Initial GraphQL client commit

This commit is contained in:
Robert committed 2023-02-04 23:29:26 +01:00
1 parent f2ef657d00
commit 3222eae876
11 files changed
+389 -2

No files matched your search

@@ -0,0 +1,26 @@
using DryIoc;
using DryIoc.Microsoft.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
namespace Artemis.WebClient.Updating.DryIoc;
/// <summary>
/// Provides an extension method to register services onto a DryIoc <see cref="IContainer"/>.
/// </summary>
public static class ContainerExtensions
{
/// <summary>
/// Registers the updating client into the container.
/// </summary>
/// <param name="container">The builder building the current container</param>
public static void RegisterUpdatingClient(this IContainer container)
{
ServiceCollection serviceCollection = new();
serviceCollection
.AddHttpClient()
.AddUpdatingClient()
.ConfigureHttpClient(client => client.BaseAddress = new Uri("https://updating.artemis-rgb.com/graphql"));
container.WithDependencyInjectionAdapter(serviceCollection);
}
}