Table of Contents

Method MapFrom

Namespace
Mapperion
Assembly
Mapperion.dll

MapFrom<TSourceMember>(Expression<Func<TSource, TSourceMember>>)

Takes the value from the given source expression. A plain member chain such as s => s.Customer.Name is recorded as a member path the compiler can inline; anything else is kept as an opaque expression.

void MapFrom<TSourceMember>(Expression<Func<TSource, TSourceMember>> sourceMember)

Parameters

sourceMember Expression<Func<TSource, TSourceMember>>

The expression that reads the value.

Type Parameters

TSourceMember

The type the expression produces.

MapFrom(string)

Takes the value from the source member of the given name, or from the dotted path to one.

void MapFrom(string sourceMember)

Parameters

sourceMember string

The source member name, or a dotted path to one.

Remarks

The name is resolved while the configuration is built, so a misspelling is a configuration error and not a member that quietly maps to nothing.

Exceptions

ArgumentNullException

sourceMember is null.

MapperConfigurationException

The source has no member of that name.

MapFrom<TValueResolver>()

Takes the value from a resolver, which sees the whole source and destination.

void MapFrom<TValueResolver>() where TValueResolver : IValueResolver<TSource, TDestination, TMember>

Type Parameters

TValueResolver

The resolver, which needs a parameterless constructor.