Table of Contents

Class XmlSerializationInputFormatter

Namespace
Cuemon.Extensions.AspNetCore.Mvc.Formatters.Xml
Assembly
Cuemon.Extensions.AspNetCore.Mvc.Formatters.Xml.dll

This class handles deserialization of XML to objects using XmlFormatter.

public class XmlSerializationInputFormatter : StreamInputFormatter<XmlFormatter, XmlFormatterOptions>, IInputFormatter, IApiRequestFormatMetadataProvider, IConfigurable<XmlFormatterOptions>
Inheritance
XmlSerializationInputFormatter
Implements
Inherited Members
Extension Methods

Examples

The following example demonstrates how to construct an and inspect its supported media types and encodings.

using System;
using System.Linq;
using Cuemon.Extensions.AspNetCore.Mvc.Formatters.Xml;
using Cuemon.Xml.Serialization.Formatters;

namespace DocfxExamples;

public class XmlSerializationInputFormatterExample
{
    public void Demonstrate()
    {
        var options = new XmlFormatterOptions();
        var formatter = new XmlSerializationInputFormatter(options);

        Console.WriteLine($"Supported media types: {string.Join(", ", formatter.SupportedMediaTypes)}");
        Console.WriteLine($"Supported encodings: {string.Join(", ", formatter.SupportedEncodings.Select(e => e.WebName))}");

}
}

Constructors

XmlSerializationInputFormatter(XmlFormatterOptions)

Initializes a new instance of the XmlSerializationInputFormatter class.

public XmlSerializationInputFormatter(XmlFormatterOptions options)

Parameters

options XmlFormatterOptions

The XmlFormatterOptions which need to be configured.