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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:33:08+00:00 2026-05-25T09:33:08+00:00

I was learning AutoMapper and understand its use for object to object mapping. But

  • 0

I was learning AutoMapper and understand its use for object to object mapping. But now EFCodeFirst,dapper and Petpoco all cools stuff are there which will allow us to use our POCO directly with database?

So can anybody let me know why we still need automapper?

Thanks in advance

Best Regards,
Jalpesh

  • 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-25T09:33:08+00:00Added an answer on May 25, 2026 at 9:33 am

    I usually use Automapper to map Domain models to view mdoels. If doing DDD it is often suggested that it’s not a great idea to use your Domain models in you views – views often have a different set of concerns to the domain.

    For example, you may have a User model in your domain:

    public class User
    {
      public int Id {get;set;}
      public string EmailAddress {get;set;}
      public string FirstName {get;set;}
      public string Surname {get;set;}
      public string HashedPassword {get;set;}
      public string EyeColour {get;set;}
    }
    

    And you may have a User summary page which shows a subset of these items:

    public class UserSummary
    {
      public string EmailAddress {get;set;}
      public string Surname {get;set;}
    }
    

    You could use the UserSummary class on the view, but you would probably fetch the domain user model from the db. In this case you could use Automapper to map the Domain.User to the ViewModel.UserSummary

    var user = _repository.Get(1);
    var viewmodel = Automapper.Map<Domain.User, ViewModel.UserSummary>(user);
    return View(viewmodel);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Learning my way through this stuff and could use some help. I'm trying to
Still Learning MVC3, EF. For now I am connecting to MySql but I believe
For learning and demonstrating, I need a macro which prints its parameter and evaluates
Learning Ruby. Needed to create a hash of arrays. This works... but I don't
Learning CasperJS Trying to understand why the following is not displaying my results in
learning html/css here. I can't seem to understand how to tweak this drop down
learning Jquery and integrating with PHP - getting there, but have one last challenge
Learning how to use scala DSL:s and quite a few examples work nice. However
Learning client side code of an existing site, would like to understand some activity
learning Hibernate and its really making me crazy i am trying to persist an

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.