Table of Contents

Class Mapper<T>

Namespace
adas_core.Domain.Utils
Assembly
adas-core.Domain.dll
public static class Mapper<T> where T : class

Type Parameters

T
Inheritance
Mapper<T>
Inherited Members

Methods

Map(ExpandoObject, T)

Maps properties from an ExpandoObject source to a strongly-typed destination object using a pre-defined property map. Property lookups are case-insensitive. Null values are only assigned to reference types or Nullable<T> types; assigning null to a non-nullable value type throws. When a source value's type does not match the destination property's type, the value is converted using ToDouble(object).

public static void Map(ExpandoObject source, T destination)

Parameters

source ExpandoObject

The source ExpandoObject whose key-value pairs will be mapped onto the destination.

destination T

The target object that will receive the mapped property values.

Exceptions

ArgumentNullException

Thrown when source or destination is null.

ArgumentException

Thrown when a source value is null but the corresponding destination property is a value type that is not Nullable<T>.