Table of Contents

FirstOrDefaultWriterConverter Method

Definition

FirstOrDefaultWriterConverter(IList<XmlConverter>, Type)

Returns the first XmlConverter of the converters that CanConvert(Type) and CanWrite the specified objectType; otherwise null if no XmlConverter is found.

public static XmlConverter FirstOrDefaultWriterConverter(this IList<XmlConverter> converters, Type objectType)

Parameters

converters IList<XmlConverter>

The IList<T> to extend.

objectType Type

Type of the object to serialize.

Returns

XmlConverter

An XmlConverter that can serialize the specified objectType; otherwise null.

Exceptions

ArgumentNullException

converters cannot be null.