AddYamlExceptionResponseFormatter Method
Definition
- Namespace
- Codebelt.Extensions.AspNetCore.Text.Yaml.Formatters
- Assemblies
- Codebelt.Extensions.AspNetCore.Text.Yaml.dll
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