Class ServiceCollectionExtensions
- Namespace
- Cuemon.Extensions.AspNetCore.Text.Json
- Assembly
- Cuemon.Extensions.AspNetCore.Text.Json.dll
Extension methods for the IServiceCollection interface.
public static class ServiceCollectionExtensions
- Inheritance
-
ServiceCollectionExtensions
Methods
AddMinimalJsonOptions(IServiceCollection, Action<JsonFormatterOptions>)
Adds a JsonFormatterOptions service to the specified IServiceCollection.
public static IServiceCollection AddMinimalJsonOptions(this IServiceCollection services, Action<JsonFormatterOptions> setup = null)
Parameters
servicesIServiceCollectionThe IServiceCollection to add services to.
setupAction<JsonFormatterOptions>The JsonFormatterOptions which may be configured.
Returns
- IServiceCollection
An IServiceCollection that can be used to further configure other services.
Remarks
This method registers a MinimalJsonOptions configuration as a singleton IConfigureOptions<TOptions> for JsonOptions and delegates to AddJsonExceptionResponseFormatter(IServiceCollection, Action<JsonFormatterOptions>) to configure the JSON exception response formatter.
Exceptions
- ArgumentNullException
servicescannot be null.