Skip to content

Mapping from Entity to Tuple<dto1, dto2> after updating to .Net7 & 12.0.1 #4335

Closed Answered by AllanMichaelsen
AllanMichaelsen asked this question in Q&A
Discussion options

You must be logged in to vote

I did make a change and this works:

    private static void Main()
    {
        var config = new MapperConfiguration(c =>
        {
            c.CreateMap<OrderHeaderEntity, OrderHeaderDto>();

            c.CreateMap<OrderHeaderEntity, OrderHeaderOrderManagerOverviewDto>();

            c.CreateMap<OrderHeaderEntity, (OrderHeaderDto orderHeaderDto, OrderHeaderOrderManagerOverviewDto orderHeaderOrderManagerOverviewDto)>()
                .ForMember(dest => dest.orderHeaderDto, act => act.MapFrom(src => src))
                .ForMember(dest => dest.orderHeaderOrderManagerOverviewDto, act => act.MapFrom(src => src));
        });

        config.AssertConfigurationIsValid();

        var m…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@AllanMichaelsen
Comment options

@lbargaoanu
Comment options

@AllanMichaelsen
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by AllanMichaelsen
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