Class Mapper<T>
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
sourceExpandoObjectThe source ExpandoObject whose key-value pairs will be mapped onto the destination.
destinationTThe target object that will receive the mapped property values.
Exceptions
- ArgumentNullException
Thrown when
sourceordestinationis null.- ArgumentException
Thrown when a source value is null but the corresponding destination property is a value type that is not Nullable<T>.