mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-14 21:06:29 +00:00
Updating - Initial GraphQL client commit
This commit is contained in:
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);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user