src/StarCitizen-API-Wrapper.Library/Services/ServiceCollectionExtension.cs
/// <summary>
/// Adds the <see cref="StarCitizenClient"/> to the service collection.
/// </summary>
Adds the  to the service collection.
Adds the to the service collection .
public static IServiceCollection AddStarCitizenApiClient(this IServiceCollection services,
            IConfiguration configuration)
        {
            services.Configure<StarCitizenClientConfiguration>(
                configuration.GetSection(StarCitizenClientConfiguration.StarCitizenClient));
            services.Configure<StarCitizenClientJsonSerializerOptions>(x =>
            {
                var options = new JsonSerializerOptions
                {
                    PropertyNameCaseInsensitive = true,
                    Converters = { new JsonStringEnumConverter(JsonNamingPolicy.CamelCase) }
                };
                x.JsonSerializerOptions = options;
            });
            services.AddTransient<IStarCitizenClient, StarCitizenClient>();
            services.AddHttpClient<IHttpClientService, HttpClientService>();
            return services;
        }
public static IServiceCollection AddStarCitizenApiClient ( this IServiceCollection services , IConfiguration configuration ) { services . Configure < StarCitizenClientConfiguration > ( configuration . GetSection ( StarCitizenClientConfiguration . StarCitizenClient ) ) ; services . Configure < StarCitizenClientJsonSerializerOptions > ( x => { var options = new JsonSerializerOptions { PropertyNameCaseInsensitive = true , Converters = { new JsonStringEnumConverter ( JsonNamingPolicy . CamelCase ) } } ; x . JsonSerializerOptions = options ; } ) ; services . AddTransient < IStarCitizenClient , StarCitizenClient > ( ) ; services . AddHttpClient < IHttpClientService , HttpClientService > ( ) ; return services ; }
Adds the  to the service collection.
Adds the to the service collection .
IServiceCollection
this
configuration
IConfiguration