Class YamlResponseNegotiator
- Namespace
- Codebelt.Extensions.Carter.AspNetCore.Text.Yaml
- Assembly
- Codebelt.Extensions.Carter.AspNetCore.Text.Yaml.dll
Provides a YAML response negotiator for Carter, capable of serializing response models to YAML format.
public class YamlResponseNegotiator : ConfigurableResponseNegotiator<YamlFormatterOptions>, IConfigurable<YamlFormatterOptions>, IResponseNegotiator
- Inheritance
-
YamlResponseNegotiator
- Implements
- Inherited Members
Constructors
YamlResponseNegotiator(IOptions<YamlFormatterOptions>)
Initializes a new instance of the YamlResponseNegotiator class.
public YamlResponseNegotiator(IOptions<YamlFormatterOptions> options)
Parameters
optionsIOptions<YamlFormatterOptions>The YamlFormatterOptions used to configure YAML serialization and supported media types.
Methods
GetDefaultEncoding()
Returns the character encoding specified by the YamlFormatterOptions.
protected override Encoding GetDefaultEncoding()
Returns
GetFormatter()
Returns a new YamlFormatter configured with the current YamlFormatterOptions.
public override StreamFormatter<YamlFormatterOptions> GetFormatter()
Returns
- StreamFormatter<YamlFormatterOptions>
A YamlFormatter instance configured with the current YamlFormatterOptions.
See Also
ConfigurableResponseNegotiator<TOptions>