nclient / NClient

:dizzy: NClient is an automatic type-safe .Net HTTP client that allows you to call web service API methods using annotated interfaces or controllers without boilerplate code.
Apache License 2.0
43 stars 11 forks source link

Automatic injection of JsonSerializerOptions #410

Closed smolchanovsky closed 2 years ago

smolchanovsky commented 2 years ago

When creating a client via DI, it is necessary to use the JsonSerializerOptions added to the collection of services.

services.Configure<JsonSerializerOptions>(options =>
{
    options.JsonSerializerOptions.PropertyNameCaseInsensitive = true;
});
services.AddNClient<IFileClient>(host: "http://localhost:5001");     // Use JsonSerializerOptions from AddJsonOptions method
smolchanovsky commented 2 years ago

@Kingmidas74, do you wish to solve this problem? :)