XmlDataContractSerializerInputFormatter Class¶
Summary¶
This class handles deserialization of input XML data to strongly-typed objects using [System.Runtime.Serialization.DataContractSerializer]().
Constructors¶
-
Microsoft.AspNet.Mvc.Xml.XmlDataContractSerializerInputFormatter.XmlDataContractSerializerInputFormatter()
Initializes a new instance of DataContractSerializerInputFormatter
public XmlDataContractSerializerInputFormatter()
-
Properties¶
-
MaxDepth
()¶ Indicates the acceptable input XML depth.
Return type: System.Int32 public int MaxDepth { get; set; }
-
SerializerSettings
()¶ Gets or sets the [System.Runtime.Serialization.DataContractSerializerSettings]() used to configure the [System.Runtime.Serialization.DataContractSerializer]().
Return type: System.Runtime.Serialization.DataContractSerializerSettings public DataContractSerializerSettings SerializerSettings { get; set; }
-
WrapperProviderFactories
()¶ Gets the list of [Microsoft.AspNet.Mvc.Xml.IWrapperProviderFactory](Microsoft.AspNet.Mvc.Xml.IWrapperProviderFactory.yml) to provide the wrapping type for de-serialization.
Return type: System.Collections.Generic.IList{Microsoft.AspNet.Mvc.Xml.IWrapperProviderFactory} public IList<IWrapperProviderFactory> WrapperProviderFactories { get; }
-
XmlDictionaryReaderQuotas
()¶ The quotas include - DefaultMaxDepth, DefaultMaxStringContentLength, DefaultMaxArrayLength, DefaultMaxBytesPerRead, DefaultMaxNameTableCharCount
Return type: System.Xml.XmlDictionaryReaderQuotas public XmlDictionaryReaderQuotas XmlDictionaryReaderQuotas { get; }
-
Methods¶
-
CanReadType
(System.Type)¶ Arguments: - type (System.Type) –
Return type: System.Boolean
protected override bool CanReadType(Type type)
-
CreateSerializer
(System.Type)¶ Called during deserialization to get the [System.Runtime.Serialization.DataContractSerializer]().
Arguments: - type (System.Type) – The type of object for which the serializer should be created.
Return type: System.Runtime.Serialization.DataContractSerializer
Returns: The [System.Runtime.Serialization.DataContractSerializer]() used during deserialization.
protected virtual DataContractSerializer CreateSerializer(Type type)
-
CreateXmlReader
(System.IO.Stream, System.Text.Encoding)¶ Called during deserialization to get the [System.Xml.XmlReader]().
Arguments: - readStream (System.IO.Stream) – The [System.IO.Stream]() from which to read.
- encoding (System.Text.Encoding) – The [System.Text.Encoding]() used to read the stream.
Return type: System.Xml.XmlReader
Returns: The [System.Xml.XmlReader]() used during deserialization.
protected virtual XmlReader CreateXmlReader(Stream readStream, Encoding encoding)
-
GetCachedSerializer
(System.Type)¶ Gets the cached serializer or creates and caches the serializer for the given type.
Arguments: - type (System.Type) –
Return type: System.Runtime.Serialization.DataContractSerializer
Returns: The [System.Runtime.Serialization.DataContractSerializer]() instance.
protected virtual DataContractSerializer GetCachedSerializer(Type type)
-
GetSerializableType
(System.Type)¶ Gets the type to which the XML will be deserialized.
Arguments: - declaredType (System.Type) – The declared type.
Return type: System.Type
Returns: The type to which the XML will be deserialized.
protected virtual Type GetSerializableType(Type declaredType)
-
ReadRequestBodyAsync
(Microsoft.AspNet.Mvc.InputFormatterContext)¶ Reads the input XML.
Arguments: - context (Microsoft.AspNet.Mvc.InputFormatterContext) – The input formatter context which contains the body to be read.
Return type: System.Threading.Tasks.Task{System.Object}
Returns: Task which reads the input.
public override Task<object> ReadRequestBodyAsync(InputFormatterContext context)
-