Class ServiceCollectionExtensions
- Namespace
- Codebelt.Extensions.AspNetCore.Text.Yaml.Formatters
- Assembly
- Codebelt.Extensions.AspNetCore.Text.Yaml.dll
Extension methods for the IServiceCollection interface.
public static class ServiceCollectionExtensions
- Inheritance
-
ServiceCollectionExtensions
Methods
AddYamlExceptionResponseFormatter(IServiceCollection, Action<YamlFormatterOptions>)
Adds an IHttpExceptionDescriptorResponseFormatter that uses YamlFormatter as engine of serialization to the specified list of services.
public static IServiceCollection AddYamlExceptionResponseFormatter(this IServiceCollection services, Action<YamlFormatterOptions> setup = null)
Parameters
servicesIServiceCollectionThe IServiceCollection to extend.
setupAction<YamlFormatterOptions>The YamlFormatterOptions which may be configured.
Returns
- IServiceCollection
A reference to
servicesso that additional calls can be chained.
Remarks
Configuration of the YamlFormatter is done through a call to GetService<T>(IServiceProvider) retrieving an IOptions<TOptions> implementation of YamlFormatterOptions.
Exceptions
- ArgumentNullException
servicescannot be null
AddYamlFormatterOptions(IServiceCollection, Action<YamlFormatterOptions>)
Adds configuration of YamlFormatterOptions for the application.
public static IServiceCollection AddYamlFormatterOptions(this IServiceCollection services, Action<YamlFormatterOptions> setup = null)
Parameters
servicesIServiceCollectionThe IServiceCollection to extend.
setupAction<YamlFormatterOptions>The YamlFormatterOptions which may be configured.
Returns
- IServiceCollection
A reference to
servicesso that additional configuration calls can be chained.
Exceptions
- ArgumentNullException
servicescannot be null.