Table of Contents

XmlSerializationInputFormatter Class

Definition

Namespace
Cuemon.Extensions.AspNetCore.Mvc.Formatters.Xml
Assemblies
Cuemon.Extensions.AspNetCore.Mvc.Formatters.Xml.dll
Source
src/Cuemon.Extensions.AspNetCore.Mvc.Formatters.Xml/XmlSerializationInputFormatter.cs

This class handles deserialization of XML to objects using XmlFormatter.

public class XmlSerializationInputFormatter : StreamInputFormatter<XmlFormatter, XmlFormatterOptions>, IInputFormatter, IApiRequestFormatMetadataProvider, IConfigurable<XmlFormatterOptions>
Inheritance
object
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

Name Description
XmlSerializationInputFormatter(XmlFormatterOptions)

Initializes a new instance of the XmlSerializationInputFormatter class.