Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8358171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T10:42:52+00:00 2026-06-09T10:42:52+00:00

I am currently testing with AutoMapper, but i currently have a case where the

  • 0

I am currently testing with AutoMapper, but i currently have a case where the property names do not match each other, so a custom type convert was needed.
But when i use the custom type converter, i have to map all other properties manually? i can’t call another Map inside the type converter ofcourse as this will cause a overflow.

This is unwanted as there are at most 3 model specific properties that do not match per model so i DO want the other properties to be automaticaly mapped.

Could anyone point me in the right direction for this one?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T10:42:53+00:00Added an answer on June 9, 2026 at 10:42 am

    You don’t need to use a custom type converter to map classes where there a few properties that simply have names that don’t match. Custom type converters are for when you need to, as they say, “take complete control over the conversion of one type to another”.

    Set up the map with CreateMap() and then set some extra rules using ForMember(), like this:

    Mapper.CreateMap<Person, Customer>()
        .ForMember(dest => dest.Surname, opt => opt.MapFrom(src => src.LastName))
        .ForMember(dest => dest.DateOfBirth, opt => opt.MapFrom(src => src.DOB));
    

    This maps LastName and DOB from the source Person class to the Surname and DateOfBirth properties of the destination Customer class.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently testing a small application I have written. I have not been
I have started to try out noSQL databases now and are currently testing out
I'm currently testing my mailers with RSpec, but I've started setting up multipart emails
I have an application that I'm currently testing that listens for requests over the
I have one probably dumb question. I am currently testing CSP solvers choco and
I'm currently testing MonoDevelop for my hobbist projects needs. It seems like i have
We have a client and server application currently testing on the same Windows 7
I'm currently testing Lucene.Net, and it's perfect for my needs but I've seen this
I'm currently testing drag & drop. Drag & dropping an image from my desktop
I am currently testing sharepoint components using msTest, which works nicely. However, when I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.