tgstation-server 6.16.0
The /tg/station 13 server suite
Loading...
Searching...
No Matches
GraphQLGitLabClient.cs
Go to the documentation of this file.
1using System;
2using System.Threading.Tasks;
3
4using Microsoft.Extensions.DependencyInjection;
5
7{
10 {
12 public IGraphQLClient GraphQL { get; }
13
17 readonly ServiceProvider serviceProvider;
18
23 public GraphQLGitLabClient(ServiceProvider serviceProvider)
24 {
25 this.serviceProvider = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider));
26 GraphQL = serviceProvider.GetService<IGraphQLClient>() ?? throw new ArgumentException($"Expected an {nameof(IGraphQLClient)} service in the provider!", nameof(serviceProvider));
27 }
28
30 public ValueTask DisposeAsync()
31 => serviceProvider.DisposeAsync();
32 }
33}
IGraphQLClient GraphQL
Gets the underlying IGraphQLClient.
readonly ServiceProvider serviceProvider
The ServiceProvider containing the GraphQL client.
GraphQLGitLabClient(ServiceProvider serviceProvider)
Initializes a new instance of the GraphQLGitLabClient class.