Skip to content
Discussion options

You must be logged in to vote

You'll need custom expressions when the types are not an exact match e.g.

		CreateMap<Product, PricedProductModel>()
			.ForMember(dest => dest.Price, opts => opts.MapFrom(x => x.Price.Value));

or for constructor maps:

		CreateMap<Product, PricedProductModel>()
			.ForCtorParam("Price", opts => opts.MapFrom(x => x.Price.Value));

If custom expressions don't work then open an issue with sample reproducing the error.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@BlaiseD
Comment options

@npbenjohnson
Comment options

Answer selected by BlaiseD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants