Table of Contents

FirstOrDefaultWriterConverter Method

Definition

FirstOrDefaultWriterConverter(IDecorator<IList<XmlConverter>>, Type)

Returns the first XmlConverter of the enclosed IList<T> of the specified decorator that CanConvert(Type) and CanWrite the specified objectType; otherwise null if no XmlConverter is found.

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

Parameters

decorator IDecorator<IList<XmlConverter>>

The decorator that wraps 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

decorator cannot be null.