Table of Contents

Interface IMemberConfigurationExpression<TSource, TDestination, TMember>

Namespace
Mapperion
Assembly
Mapperion.dll

Configures how one destination member is populated.

public interface IMemberConfigurationExpression<TSource, TDestination, TMember>

Type Parameters

TSource

The source type.

TDestination

The destination type.

TMember

The destination member type.

Methods

Condition(Expression<Func<TSource, bool>>)

Assigns the member only when the predicate holds. The source value is read first, so a condition costs the read even when it turns out false; use PreCondition(Expression<Func<TSource, bool>>) when the read itself is what you want to avoid.

ConvertUsing<TValueConverter, TSourceMember>()

Runs the resolved value through a converter before assigning it.

Ignore()

Leaves the member unmapped.

MapFrom(string)

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

MapFrom<TValueResolver>()

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

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.

NullSubstitute(object)

Substitutes a value when the source resolves to null.

PreCondition(Expression<Func<TSource, bool>>)

Skips the member entirely, before its source is even read, when the predicate does not hold. Useful when reading the source is expensive or would throw.

SetMappingOrder(int)

Sets the order in which this member is assigned relative to the others.

UseDestinationValue()

Populates the existing destination value instead of creating a new instance.