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

The Archive Base Latest Questions

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

I am working on an ASP.NET MVC application using SQL Dapper for retrieval and

  • 0

I am working on an ASP.NET MVC application using SQL Dapper for retrieval and NHibernate for CRUD. I am facing some problems with layer separation.

I have repositories say UserRepository which has public User GetUsersList() method. Here “User” is an NHibernate entity. The problem here is I need to display a field in the UI which is not present as a property in User like ‘HasAltContacts’ which I am directly retrieving from an SQL query.

Now, my question is do I need to create separate DTO’s and leave these NHibernate entities and build repositories (at least READ METHODS) around these classes?

  • 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-09T22:42:43+00:00Added an answer on June 9, 2026 at 10:42 pm

    Here “User” is NHibernate entity. The problem here is I need to
    display a field in UI which is not present as property in User like
    ‘HasAltContacts’ which I am directly receiving from SQL query.

    Define a view model that will contain all the properties your view requires. Then have your controller action populate this view model by querying the various data sources you have and pass this view model to the view.

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

Sidebar

Related Questions

I am working on a Facebook tab application. I am using asp.net MVC 2
I have an existing ASP.NET MVC application with some sample data in the SQL
I am working on asp.net mvc application using the mvc2 framework. Here is the
I am working on an ASP.NET MVC application and using jQuery. I understand from
I'm working on an application using ASP.NET MVC 1.0 and I'm trying to inject
I am working on an ASP.Net Mvc 3 application using FormsAuthentication with a custom
As I am working on Asp.Net MVC Application, in my application I am using
I am working in ASP.NET MVC 3 application, I am using razor view. I
I'm currently working on an ASP.NET MVC project using NHibernate and I need to
I'm currently working on an Intranet application project, using ASP.NET MVC 3. One of

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.