Table of Contents

Interface IMappingExpression<TSource, TDestination>

Namespace
Mapperion
Assembly
Mapperion.dll

Configures the map between one source type and one destination type.

public interface IMappingExpression<TSource, TDestination>

Type Parameters

TSource

The source type.

TDestination

The destination type.

Methods

AfterMap(Action<TSource, TDestination, ResolutionContext>)

Runs a step once every member has been assigned, with access to the running mapper.

AfterMap(Action<TSource, TDestination>)

Runs a step once every member has been assigned.

AfterMap<TMappingAction>()

Runs a step of its own type once every member has been assigned.

BeforeMap(Action<TSource, TDestination, ResolutionContext>)

Runs a step before the members are assigned, with access to the running mapper.

BeforeMap(Action<TSource, TDestination>)

Runs a step before the members are assigned, once the destination exists.

BeforeMap<TMappingAction>()

Runs a step of its own type before the members are assigned.

ConstructUsing(Func<TSource, ResolutionContext, TDestination>)

Builds the destination with the given factory, which also receives the running operation so it can map nested values itself.

ConstructUsing(Func<TSource, TDestination>)

Builds the destination with the given factory instead of calling a constructor.

ConvertUsing<TTypeConverter>()

Replaces this map entirely with a converter. Member configuration stops applying: the converter produces the destination on its own.

ForAllMembers(Action<IMemberConfigurationExpression<TSource, TDestination, object>>)

Applies the same configuration to every destination member.

ForCtorParam(string, Action<ICtorParamConfigurationExpression<TSource>>)

Configures one parameter of the destination constructor. Parameter names are matched ignoring case, because C# names parameters in camelCase and properties in PascalCase.

ForMember(string, Action<IMemberConfigurationExpression<TSource, TDestination, object>>)

Configures one destination member, named as text rather than selected by an expression.

ForMember<TMember>(Expression<Func<TDestination, TMember>>, Action<IMemberConfigurationExpression<TSource, TDestination, TMember>>)

Configures a single destination member.

ForPath<TMember>(Expression<Func<TDestination, TMember>>, Action<IMemberConfigurationExpression<TSource, TDestination, TMember>>)

Configures a member that sits inside the destination rather than on it, such as d => d.Customer.Name.

ForSourceMember(Expression<Func<TSource, object?>>, Action<ISourceMemberConfigurationExpression>)

Configures one member of the source.

IncludeBase<TBaseSource, TBaseDestination>()

Takes the member configuration of the base map as a starting point. Anything configured here wins over what the base said.

IncludeMembers(params Expression<Func<TSource, object?>>[])

Names source members whose own maps to this destination fill in whatever this map leaves unresolved, which is how one destination is built out of several nested source objects.

Include<TDerivedSource, TDerivedDestination>()

Declares that a source of the derived type should be mapped through the derived map instead of this one, so mapping through a base reference still produces the right destination type.

MaxDepth(int)

Limits how deep recursive maps descend.

PreserveReferences()

Tracks already-mapped instances so reference cycles terminate.

ReverseMap()

Declares the map in the opposite direction and returns it, so it can be configured further. Members configured here with a plain MapFrom onto a single writable source member are inverted; flattened paths, arbitrary expressions and ignored members are not, and the reverse resolves those by convention instead.

ValidateMemberList(MemberListValidation)

Sets which side must be fully covered for this map to validate.