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

  • Home
  • SEARCH
  • 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 749649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T14:27:31+00:00 2026-05-14T14:27:31+00:00

I am using AutoMapper in my project along with, NHibernate and ASP.NET MVC 2.

  • 0

I am using AutoMapper in my project along with, NHibernate and ASP.NET MVC 2.

If I have a list of DTOs or a DTO inside the parent DTO that I am mapping to the View Model, should I flatten out the inner DTOs as well ?

Edit

Should I write view model classes for the internal objects as well or should I use them as it is (as DTOs with lazy loading, due to NHibernate)?

  • 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-14T14:27:32+00:00Added an answer on May 14, 2026 at 2:27 pm

    When you map an object to object, AutoMapper trying automatically get all the destination objects properties mapped, including complex properties.

    You probably want to test that all the properties of the destination object are mapped. You can achieve that with:

    Mapper.AssertConfigurationIsValid();
    

    About your edit: the ViewModel needs to be entirely dependent on the model object. So internal objects needs to be as well specific to the view model.

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

Sidebar

Related Questions

I'm using AutoMapper in an ASP.NET MVC application. I was told that I should
In my ASP.NET MVC 2 (RC) project - I'm using AutoMapper to map between
I currently have a POCO class in my ASP.NET MVC project that handles all
I've just finished setting up a project using MVC 3, Fluent nHibernate, AutoMapper, and
I'm using Subsonic 3 and Automapper on an asp.net MVC3 project. In my HttpPost
I am using AutoMapper in my ASP.NET MVC website to map my database objects
I know that if I was using AutoMapper in an MVC project, I could
In my ASP.net mvc app I am using a Service Layer and Repositories to
In a project using NHibernate, I have this class : public class AdminVAT :
I am using ASP.NET MVC 3 and Autofac for my dependency injection. I am

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.