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 3970290
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T04:04:07+00:00 2026-05-20T04:04:07+00:00

What is the point of AutoMapper? Could someone give me a really simple example?

  • 0

What is the point of AutoMapper? Could someone give me a really simple example?

I have watched the video on it, but it is just not clicking.

Sam

  • 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-05-20T04:04:07+00:00Added an answer on May 20, 2026 at 4:04 am

    Typically AutoMapper is great at mapping between data entities and business models. E.g., lets say for instance, I have a data domain type, call it PersonEntity, and it has an array of properties: FirstName, Surname, Gender etc. I don’t want to expose my data domain type through to the consuming application, so I can define business domain types, e.g. Person, now the Person type can contain additional business logic, such as GetRelatedPersons, etc, which may not be functionality tied to your data domain. In this case, I have two types, PersonEntity and Person which at some point I will have to write boilerplate code to copy the properties from one to the other. I could do this a variety of ways, I could:

    1.Copy Constructor:

    public Person(PersonEntity entity) {
    

    2.Generalised Mapping Method:

    public Person CreatePerson(PersonEntity entity) {
    

    3.Implicit/Explicit Conversion:

    public static implicit operator Person(PersonEntity entity) {
    

    But what AutoMapper allows you to do, is easily create a mapping process between those two types. So in its simiplist form, I could:

    Person person = Mapper.Map<PersonEntity, Person>(entity);
    

    By using a convention-first approach, the AutoMapper framework will translate matching properties from one instance to the next. It also allows you to customise how the types are mapped if you want more fine grained control.

    Hope that helps.

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

Sidebar

Related Questions

Could someone please point me to an example of XML configuration for Spring 3
I have been using Automapper in our projects and just recently ran into an
A logical stuck point. I am building a simple ACL, and I am just
I have it a point that has really got me stuck and help is
Could point me to some good links, or share experiences of the differences /
I am using automapper (successfully up to a point) to perform a polymorphic map
At point (3) in my code I have defined a query called query1 in
Point three for example: Neither the name of the ORGANIZATION nor the names of
The point of this exercise is to make navigation between objects stateful. For example,
Similar questions have been asked but cannot find a solution that works well. What

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.