AutoMapper
Wraps mapping exceptions. Check exception.ToString() for the full error message.
Auto map to this destination type from the specified source type.
Discovered during scanning assembly scanning for configuration when calling
If set to true, construct the destination object using the service locator.
For self-referential types, limit recurse depth.
If set to true, preserve object identity. Useful for circular references.
If set to true, disable constructor validation.
If set to true, include this configuration in all derived types' maps.
Skip normal member mapping and convert using a instantiated during mapping.
If set to true, proxy will be created.
Ignore this member for configuration validation and skip during mapping.
Must be used in combination with
Do not precompute the execution plan for this member, just map it at runtime.
Simplifies the execution plan by not inlining.
Must be used in combination with
Supply a custom mapping order instead of what the .NET runtime returns
Must be used in combination with
Substitute a custom value when the source member resolves as null
Must be used in combination with
Value to use if source value is null
Specify the source member to map from. Can only reference a member on the type
Must be used in combination with
Use the destination value instead of mapping from the source value or creating a new instance
Must be used in combination with
Specify a value converter type to convert from the matching source member to the destination member
Use with to specify a separate source member to supply to the value converter
Must be used in combination with
type
Map destination member using a custom value resolver.
Use with to specify an type.
Must be used in combination with
or type
Specify the source member(s) to map from.
Property name referencing the source member to map against. Or a dot separated member path.
Ignore this member for LINQ projections unless explicitly expanded during projection
Map constructor parameter from member expression
Member type
Member expression
Map constructor parameter from custom func that has access to
Not used for LINQ projection (ProjectTo)
Custom func
Member configuration options
Source type for this member
Destination type for this map
Type for this member
Specify the source member to map from. Can only reference a member on the type
Any null reference exceptions in this expression will be ignored (similar to flattening behavior)
Member type of the source member to use
Expression referencing the source member to map against
Ignore this member for configuration validation and skip during mapping
Source member configuration options
Ignore this member when validating source members, MemberList.Source.
Does not affect validation for the default case, MemberList.Destination.
Contains member configuration relating to source members
Mapping configuration options for non-generic maps
Add extra configuration to the current map by also mapping the specified child objects to the destination object.
The maps from the child types to the destination need to be created explicitly.
the names of child object properties to map to the destination
Create a type mapping from the destination to the source type, with validation disabled.
This allows for two-way mapping.
Itself
Customize configuration for all members
Callback for member options
Customize individual members
Name of the member
Callback for configuring member
Itself
Mapping configuration options
Source type
Destination type
Customize configuration for a path inside the destination object.
Expression to the destination sub object
Callback for member options
Itself
Customize configuration for individual member
Expression to the top-level destination member. This must be a member on the TDestination type
Callback for member options
Itself
Customize configuration for individual member. Used when the name isn't known at compile-time
Destination member name
Callback for member options
Itself
Customize configuration for all members
Callback for member options
Include this configuration in derived types' maps
Derived source type
Derived destination type
Itself
Include the base type map's configuration in this map
Base source type
Base destination type
Itself
Customize configuration for an individual source member
Expression to source member. Must be a member of the type
Callback for member configuration options
Itself
Create a type mapping from the destination to the source type, with validation disabled.
This allows for two-way mapping.
Itself
Override the destination type mapping for looking up configuration and instantiation
Destination type to use
Apply a transformation function after any resolved destination member value with the given type
Value type to match and transform
Transformation expression
Itself
Add extra configuration to the current map by also mapping the specified child objects to the destination object.
The maps from the child types to the destination need to be created explicitly.
the child objects to map to the destination
Customize configuration for individual member
Expression to the top-level destination member. This must be a member on the TDestination type
Callback for member options
Itself
Common mapping configuration options between generic and non-generic mapping configuration
Source type
Destination type
Concrete return type for fluent interface
For self-referential types, limit recurse depth.
Enables PreserveReferences.
Number of levels to limit to
Itself
Value transformers, typically configured through explicit or extension methods.
Specify which member list to validate
Member list to validate
Itself
Supply a custom instantiation expression for the destination type
Expression to create the destination type given the source object
Itself
Customize configuration for individual constructor parameter
Constructor parameter name
Options
Itself
Skip member mapping and use a custom expression to convert to the destination type
Callback to convert from source type to destination type
Common mapping configuration options between generic and non-generic mapping configuration
Source type
Destination type
Concrete return type for fluent interface
Disable constructor validation. During mapping this map is used against an existing destination object and never constructed itself.
Itself
Construct the destination object using the service locator
Itself
Preserve object identity. Useful for circular references.
Itself
Execute a custom function to the source and/or destination types before member mapping
Not used for LINQ projection (ProjectTo)
Callback for the source/destination types
Itself
Execute a custom function to the source and/or destination types before member mapping
Not used for LINQ projection (ProjectTo)
Callback for the source/destination types
Itself
Execute a custom mapping action before member mapping
Not used for LINQ projection (ProjectTo)
Mapping action type instantiated during mapping
Itself
Execute a custom function to the source and/or destination types after member mapping
Not used for LINQ projection (ProjectTo)
Callback for the source/destination types
Itself
Execute a custom function to the source and/or destination types after member mapping
Not used for LINQ projection (ProjectTo)
Callback for the source/destination types
Itself
Execute a custom mapping action after member mapping
Not used for LINQ projection (ProjectTo)
Mapping action type instantiated during mapping
Itself
Include this configuration in all derived types' maps. Works by scanning all type maps for matches during configuration.
Itself
Include this configuration in derived types' maps
Derived source type
Derived destination type
Itself
Include the base type map's configuration in this map
Base source type
Base destination type
Customize configuration for an individual source member. Member name not known until runtime
Expression to source member. Must be a member of the type
Callback for member configuration options
Itself
Ignores all properties that have either a private or protected setter, forcing the mapper to respect encapsulation (note: order matters, so place this before explicit configuration of any properties with an inaccessible setter)
Itself
When using ReverseMap, ignores all properties that have either a private or protected setter, keeping the reverse mapping consistent with the forward mapping (note: properties with an inaccessible setter may still be mapped unless IgnoreAllPropertiesWithAnInaccessibleSetter is also used)
Itself
Supply a custom instantiation function for the destination type, based on the entire resolution context
Not used for LINQ projection (ProjectTo)
Callback to create the destination type given the current resolution context
Itself
Override the destination type mapping for looking up configuration and instantiation
Create at runtime a proxy type implementing the destination interface.
Itself
Skip normal member mapping and convert using a instantiated during mapping
Use this method if you need to specify the converter type at runtime
Type converter type
Skip member mapping and use a custom function to convert to the destination type
Not used for LINQ projection (ProjectTo)
Callback to convert from source type to destination type, including destination object
Skip member mapping and use a custom function to convert to the destination type
Not used for LINQ projection (ProjectTo)
Callback to convert from source type to destination type, with source, destination and context
Skip member mapping and use a custom type converter instance to convert to the destination type
Not used for LINQ projection (ProjectTo)
Type converter instance
Skip member mapping and use a custom type converter instance to convert to the destination type
Not used for LINQ projection (ProjectTo)
Type converter type
Custom mapping action
Source type
Destination type
Implementors can modify both the source and destination objects
Source object
Destination object
Resolution context
Converts source type to destination type instead of normal member mapping
Source type
Destination type
Performs conversion from source to destination type
Source object
Destination object
Resolution context
Destination object
Options for a single map operation
Construct services using this callback. Use this for child/nested containers
Add context items to be accessed at map time inside an or
Execute a custom function to the source and/or destination types before member mapping
Callback for the source/destination types
Execute a custom function to the source and/or destination types after member mapping
Callback for the source/destination types
Execute a custom function to the source and/or destination types before member mapping
Callback for the source/destination types
Execute a custom function to the source and/or destination types after member mapping
Callback for the source/destination types
Member configuration options
Source type for this member
Type for this member
Destination type for this map
Do not precompute the execution plan for this member, just map it at runtime.
Simplifies the execution plan by not inlining.
Map destination member using a custom value resolver
Not used for LINQ projection (ProjectTo)
Value resolver type
Map destination member using a custom member value resolver supplied with a source member
Not used for LINQ projection (ProjectTo)
Value resolver type
Source member to supply
Map destination member using a custom member value resolver supplied from a source member name
Not used for LINQ projection (ProjectTo)
Value resolver type
Source member to supply
Source member name
Map destination member using a custom value resolver instance
Not used for LINQ projection (ProjectTo)
Value resolver instance to use
Map destination member using a custom value resolver instance
Not used for LINQ projection (ProjectTo)
Value resolver instance to use
Source member to supply to value resolver
Map destination member using a custom function. Access both the source and destination object.
Not used for LINQ projection (ProjectTo)
Function to map to destination member
Map destination member using a custom function. Access the source, destination object, and destination member.
Not used for LINQ projection (ProjectTo)
Function to map to destination member
Map destination member using a custom function. Access the source, destination object, destination member, and context.
Not used for LINQ projection (ProjectTo)
Function to map to destination member
Specify the source member(s) to map from.
Property name referencing the source member to map against. Or a dot separated member path.
Supply a custom mapping order instead of what the .NET runtime returns
Mapping order value
Reset UseDestinationValue.
Use the destination value instead of mapping from the source value or creating a new instance
Conditionally map this member against the source, destination, source and destination members
Condition to evaluate using the source object
Conditionally map this member
Condition to evaluate using the source object
Conditionally map this member
Condition to evaluate using the source object
Conditionally map this member
Condition to evaluate using the source object
Conditionally map this member
Condition to evaluate using the source object
Conditionally map this member, evaluated before accessing the source value
Condition to evaluate using the source object
Conditionally map this member, evaluated before accessing the source value
Condition to evaluate using the current resolution context
Conditionally map this member, evaluated before accessing the source value
Condition to evaluate using the source object and the current resolution context
Conditionally map this member, evaluated before accessing the source value
Condition to evaluate using the source object, the destination object, and the current resolution context
The destination member being configured.
Specify a value converter to convert from the matching source member to the destination member
Value converters are similar to type converters, but scoped to a single member. Value resolvers receive the enclosed source/destination objects as parameters.
Value converters do not. This makes it possible to reuse value converters across multiple members and multiple maps.
Value converter type
Source member type
Specify a value converter to convert from the specified source member to the destination member
Value converters are similar to type converters, but scoped to a single member. Value resolvers receive the enclosed source/destination objects as parameters.
Value converters do not. This makes it possible to reuse value converters across multiple members and multiple maps.
Value converter type
Source member type
Source member to supply to the value converter
Specify a value converter to convert from the specified source member name to the destination member
Value converters are similar to type converters, but scoped to a single member. Value resolvers receive the enclosed source/destination objects as parameters.
Value converters do not. This makes it possible to reuse value converters across multiple members and multiple maps.
Value converter type
Source member type
Source member name to supply to the value converter
Specify a value converter instance to convert from the matching source member to the destination member
Value converters are similar to type converters, but scoped to a single member. Value resolvers receive the enclosed source/destination objects as parameters.
Value converters do not. This makes it possible to reuse value converters across multiple members and multiple maps.
Source member type
Value converter instance
Specify a value converter instance from the specified source member to the destination member
Value converters are similar to type converters, but scoped to a single member. Value resolvers receive the enclosed source/destination objects as parameters.
Value converters do not. This makes it possible to reuse value converters across multiple members and multiple maps.
Source member type
Value converter instance
Source member to supply to the value converter
Specify a value converter instance to convert from the specified source member name to the destination member
Value converters are similar to type converters, but scoped to a single member. Value resolvers receive the enclosed source/destination objects as parameters.
Value converters do not. This makes it possible to reuse value converters across multiple members and multiple maps.
Source member type
Value converter instance
Source member name to supply to the value converter
Configuration options for an individual member
Map destination member using a custom value resolver. Used when the value resolver is not known at compile-time
Not used for LINQ projection (ProjectTo)
Value resolver type
Map destination member using a custom value resolver. Used when the value resolver is not known at compile-time
Not used for LINQ projection (ProjectTo)
Value resolver type
Member to supply to value resolver
Map destination member using a custom value resolver instance
Not used for LINQ projection (ProjectTo)
Value resolver instance to use
Source member to supply to value resolver
Specify a value converter type to convert from the matching source member to the destination member
Value converters are similar to type converters, but scoped to a single member. Value resolvers receive the enclosed source/destination objects as parameters.
Value converters do not. This makes it possible to reuse value converters across multiple members and multiple maps.
Value converter type
Specify a value converter type to convert from the specified source member name to the destination member
Value converters are similar to type converters, but scoped to a single member. Value resolvers receive the enclosed source/destination objects as parameters.
Value converters do not. This makes it possible to reuse value converters across multiple members and multiple maps.
Value converter type
Source member name to supply to the value converter
Specify a value converter instance to convert from the specified source member name to the destination member
Value converters are similar to type converters, but scoped to a single member. Value resolvers receive the enclosed source/destination objects as parameters.
Value converters do not. This makes it possible to reuse value converters across multiple members and multiple maps.
Source member type
Destination member type
Value converter instance
Source member name to supply to the value converter
Member configuration options
Source type for this member
Type for this member
Destination type for this map
Substitute a custom value when the source member resolves as null
Value to use
Map destination member using a custom expression. Used in LINQ projection (ProjectTo).
Member type of the source member to use
Map expression
Ignore this member for configuration validation and skip during mapping
Allow this member to be null. Overrides AllowNullDestinationValues/AllowNullCollection.
Don't allow this member to be null. Overrides AllowNullDestinationValues/AllowNullCollection.
Ignore this member for LINQ projections unless explicitly expanded during projection
Apply a transformation function after any resolved destination member value with the given type
Transformation expression
Converts a source member value to a destination member value
Source member type
Destination member type
Perform conversion from source member value to destination member value
Source member object
Resolution context
Destination member value
Extension point to provide custom resolution for a destination value
Implementors use source object to provide a destination object.
Source object
Destination object, if exists
Destination member
The context of the mapping
Result, typically build from the source resolution result
Extension point to provide custom resolution for a destination value
Implementors use source object to provide a destination object.
Source object
Destination object, if exists
Source member
Destination member
The context of the mapping
Result, typically build from the source resolution result
Defines a naming convention strategy
Configuration for profile-specific maps
Disable constructor mapping. Use this if you don't intend to have AutoMapper try to map to constructors
Creates a mapping configuration from the type to the type
Source type
Destination type
Mapping expression for more configuration options
Creates a mapping configuration from the type to the type.
Specify the member list to validate against during configuration validation.
Source type
Destination type
Member list to validate
Mapping expression for more configuration options
Creates a projection configuration from the type to the type
Source type
Destination type
Mapping expression for more configuration options
Creates a projection configuration from the type to the type.
Specify the member list to validate against during configuration validation.
Source type
Destination type
Member list to validate
Mapping expression for more configuration options
Create a mapping configuration from the source type to the destination type.
Use this method when the source and destination type are known at runtime and not compile time.
Source type
Destination type
Mapping expression for more configuration options
Creates a mapping configuration from the source type to the destination type.
Specify the member list to validate against during configuration validation.
Source type
Destination type
Member list to validate
Mapping expression for more configuration options
Clear the list of recognized prefixes.
Recognize a list of prefixes to be removed from source member names when matching
List of prefixes
Recognize a list of postfixes to be removed from source member names when matching
List of postfixes
Provide a new value for a part of a members name
Original member value
New member value
Recognize a list of prefixes to be removed from destination member names when matching
List of prefixes
Recognize a list of postfixes to be removed from destination member names when matching
List of postfixes
Add a property name to globally ignore. Matches against the beginning of the property names.
Property name to match against
Allow null destination values. If false, destination objects will be created for deep object graphs. Default true.
Allow null destination collections. If true, null source collections result in null destination collections. Default false.
Naming convention for source members
Naming convention for destination members
Include extension methods against source members for matching destination members to. Default source extension methods from
Static type that contains extension methods
Value transformers. Modify the list directly or use
Member list to check for configuration validation
Check that all destination members are mapped
Check that all source members are mapped
Check neither source nor destination members, skipping validation
Dry run all configured type maps and throw for each problem
Create a mapper instance based on this configuration. Mapper instances are lightweight and can be created as needed.
The mapper instance
Create a mapper instance with the specified service constructor to be used for resolvers and type converters.
Service factory to create services
The mapper instance
Builds the execution plan used to map the source to destination.
Useful to understand what exactly is happening during mapping.
See the wiki for details.
the runtime type of the source object
the runtime type of the destination object
the execution plan
Compile all underlying mapping expressions to cached delegates.
Use if you want AutoMapper to compile all mappings up front instead of deferring expression compilation for each first map.
Add an existing profile
Profile to add
Add an existing profile type. Profile will be instantiated and added to the configuration.
Profile type
Add an existing profile type. Profile will be instantiated and added to the configuration.
Profile type
Add profiles contained in an IEnumerable
IEnumerable of Profile
Add mapping definitions contained in assemblies.
Looks for definitions and classes decorated with
Assemblies containing mapping definitions
Add mapping definitions contained in assemblies.
Looks for definitions and classes decorated with
Assemblies containing mapping definitions
Add mapping definitions contained in assemblies.
Looks for definitions and classes decorated with
Assembly names to load and scan containing mapping definitions
Add mapping definitions contained in assemblies.
Looks for definitions and classes decorated with
Assembly names to load and scan containing mapping definitions
Add mapping definitions contained in assemblies.
Looks for definitions and classes decorated with
Types from assemblies containing mapping definitions
Add mapping definitions contained in assemblies.
Looks for definitions and classes decorated with
Types from assemblies containing mapping definitions
Supply a factory method callback for creating resolvers and type converters
Factory method
Create a named profile with the supplied configuration
Profile name, must be unique
Profile configuration
Add an action to be called when validating the configuration.
the validation callback
Allow the same map to exist in different profiles.
The default is to throw an exception, true means the maps are merged.
How many levels deep should AutoMapper try to inline the execution plan for child classes.
See the docs for details.
How many levels deep should recursive queries be expanded.
Must be zero for EF6. Can be greater than zero for EF Core.
Source extension methods included for search
Specify which properties should be mapped.
By default only public properties are mapped.
Specify which fields should be mapped.
By default only public fields are mapped.
Specify which methods, of those that are eligible (public, parameterless, and non-static or extension methods), should be mapped.
By default all eligible methods are mapped.
Specify which constructors should be considered for the destination objects.
By default all constructors are considered.
Provides a named configuration for maps. Naming conventions become scoped per profile.
Gets the feature of type .
The type of the feature.
The feature or null if feature not exists.
Add or update the feature. Existing feature of the same type will be replaced.
The feature.
Get the features collection.
Object mappers
Add an action to be called when validating the configuration.
the validation callback
Allow the same map to exist in different profiles.
The default is to throw an exception, true means the maps are merged.
How many levels deep should AutoMapper try to inline the execution plan for child classes.
See the docs for details.
How many levels deep should recursive queries be expanded.
Must be zero for EF6. Can be greater than zero for EF Core.
Get all configured type maps created
All configured type maps
Find the for the configured source and destination type
Configured source type
Configured destination type
Type map configuration
Find the for the configured type pair
Type pair
Type map configuration
Find the for the configured source and destination type
Source type
Destination type
Type map configuration
Resolve the for the configured source and destination type, checking parent types
Configured source type
Configured destination type
Type map configuration
Resolve the for the configured type pair, checking parent types
Type pair
Type map configuration
Dry run single type map
Type map to check
Dry run all type maps in given profile
Profile name of type maps to test
Dry run all type maps in given profile
Profile type
Get all configured mappers
List of mappers
Gets the features collection.
The feature collection.
Find a matching object mapper.
the types to match
the matching mapper or null
Builds the execution plan used to map the source to destination.
Useful to understand what exactly is happening during mapping.
See the wiki for details.
The source/destination map request
the execution plan
Allows to enable null-value propagation for query mapping.
Some providers (such as EntityFrameworkQueryVisitor) do not work with this feature enabled!
Factory method to create formatters, resolvers and type converters
Allows to enable null-value propagation for query mapping.
Some providers (such as EntityFrameworkQueryVisitor) do not work with this feature enabled!
Disable method mapping. Use this if you don't intend to have AutoMapper try to map from methods.
Disable fields mapping. Use this if you don't intend to have AutoMapper try to map from/to fields.
Specify common configuration for all type maps.
configuration callback
Customize configuration for all members across all maps
Condition
Callback for member options. Use the property map for conditional maps.
Contains cached reflection information for easy retrieval
Mapping execution strategy, as a chain of responsibility
When true, the mapping engine will use this mapper as the strategy
Resolution context
Is match
Builds a mapping expression equivalent to the base Map method
Source parameter
Destination parameter
Map expression
Base class for simple object mappers that don't want to use expressions.
type of the source
type of the destination
When true, the mapping engine will use this mapper as the strategy
Resolution context
Is match
Performs conversion from source to destination type
Source object
Destination object
The compile time type of the source object
The compile time type of the destination object
Resolution context
Destination object
Execute a mapping from the source object to a new destination object.
The source type is inferred from the source object.
Destination type to create
Source object to map from
Mapped destination object
Execute a mapping from the source object to a new destination object.
Source type to use, regardless of the runtime type
Destination type to create
Source object to map from
Mapped destination object
Execute a mapping from the source object to the existing destination object.
Source type to use
Destination type
Source object to map from
Destination object to map into
The mapped destination object, same instance as the object
Execute a mapping from the source object to a new destination object with explicit objects
Source object to map from
Source type to use
Destination type to create
Mapped destination object
Execute a mapping from the source object to existing destination object with explicit objects
Source object to map from
Destination object to map into
Source type to use
Destination type to use
Mapped destination object, same instance as the object
Execute a mapping from the source object to a new destination object with supplied mapping options.
Destination type to create
Source object to map from
Mapping options
Mapped destination object
Execute a mapping from the source object to a new destination object with supplied mapping options.
Source type to use
Destination type to create
Source object to map from
Mapping options
Mapped destination object
Execute a mapping from the source object to the existing destination object with supplied mapping options.
Source type to use
Destination type
Source object to map from
Destination object to map into
Mapping options
The mapped destination object, same instance as the object
Execute a mapping from the source object to a new destination object with explicit objects and supplied mapping options.
Source object to map from
Source type to use
Destination type to create
Mapping options
Mapped destination object
Execute a mapping from the source object to existing destination object with supplied mapping options and explicit objects
Source object to map from
Destination object to map into
Source type to use
Destination type to use
Mapping options
Mapped destination object, same instance as the object
Configuration provider for performing maps
Project the input queryable.
Projections are only calculated once and cached
Destination type
Queryable source
Optional parameter object for parameterized mapping expressions
Explicit members to expand
Queryable result, use queryable extension methods to project and execute result
Project the input queryable.
Destination type to map to
Queryable source
Optional parameter object for parameterized mapping expressions
Explicit members to expand
Queryable result, use queryable extension methods to project and execute result
Project the input queryable.
Queryable source
Destination type to map to
Optional parameter object for parameterized mapping expressions
Explicit members to expand
Queryable result, use queryable extension methods to project and execute result
The base class for member maps (property, constructor and path maps).
Apply a transformation function after any resolved destination member value with the given type
Value type to match and transform
Value transformer list
Transformation expression
Queryable extensions for AutoMapper
Extension method to project from a queryable using the provided mapping engine
Projections are only calculated once and cached
Destination type
Queryable source
Mapper configuration
Optional parameter object for parameterized mapping expressions
Explicit members to expand
Expression to project into
Extension method to project from a queryable using the provided mapping engine
Projections are only calculated once and cached
Destination type
Queryable source
Mapper configuration
Explicit members to expand
Expression to project into
Projects the source type to the destination type given the mapping configuration
Destination type to map to
Queryable source
Mapper configuration
Optional parameter object for parameterized mapping expressions
Explicit members to expand
Queryable result, use queryable extension methods to project and execute result
Extension method to project from a queryable using the provided mapping engine
Projections are only calculated once and cached
Queryable source
Destination type
Mapper configuration
Expression to project into
Projects the source type to the destination type given the mapping configuration
Queryable source
Destination type to map to
Mapper configuration
Optional parameter object for parameterized mapping expressions
Explicit members to expand
Queryable result, use queryable extension methods to project and execute result
Expression visitor for making member access null-safe.
NullSafeQueryRewriter is copied from the NeinLinq project, licensed under the MIT license.
Copyright (c) 2014-2018 Axel Heer.
See https://github.com/axelheer/nein-linq/blob/master/src/NeinLinq/NullsafeQueryRewriter.cs
Context information regarding resolution of a destination value
The items passed in the options of the Map call.
The items passed in the options of the Map call. Returns false when no context was passed.
Current mapper
Instance cache for resolving circular references
Instance cache for resolving keeping track of depth
Main configuration object holding all mapping configuration for a source and destination type