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
sourceMemberExpression<Func<TSource, TSourceMember>>The expression that reads the value.
Type Parameters
TSourceMemberThe 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
sourceMemberstringThe 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
sourceMemberis 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
TValueResolverThe resolver, which needs a parameterless constructor.