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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:51:54+00:00 2026-05-23T06:51:54+00:00

I am trying to get my hands on MVC. I am from ASP.Net background.

  • 0

I am trying to get my hands on MVC. I am from ASP.Net background.

After creating new mvc 3 application, i got Controller, Models and views under the same webapp project. In ASP.Net, we generally create separate projects for Models and Controllers (which i assume are same as Business Layer). Also i created a separate project for DAL where i will be using EF.

I am confused as is this the ideal solution structure? Should we not create separate projects for each layer? Since i created DAL as a separate project, i had to put a reference of WebApp in it because i wanted to return Model from the DAL and because of that now i am not able to add a reference of DAL to my WebApp.

Can someone please throw some light on what am i missing here? Am i not doing it right?

  • 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-23T06:51:54+00:00Added an answer on May 23, 2026 at 6:51 am

    MVC really leaves the “M” part up to the developer.

    Even in their official examples you’ll see variations. Your question exposes one of the most common misconceptions about MVC. You should NOT bind your domain or data models directly to views, nor should your controller methods accept them as parameters. See this post on over and under-posting.

    Ideally, your controllers will call out to a DAL, and some mechanism will map those Data or Domain models to View models. It is those View models – models that exist specifically to facilitate the UI – that should exist in the WebApp “Models” folder.

    So, you were definitely on the right track creating a new assembly to contain your DAL. One of the “easiest” mechanisms for mapping to a ViewModel is a simple method on each ViewModel:

    public class MyWidgetFormModel()
    {
       public string Name { get; set; }
       public string Price { get; set; }
    
       public MapFromDAL(DAL.Widget widget)
       {
          this.Name = widget.Name;
          this.Price = widget.Price;
       }
    }
    

    Update: based on your comments, here is an excellent answer about one user’s project layout.

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

Sidebar

Related Questions

I'm writing a new asp.net mvc application and I've been toying with the idea
Here's a little background on my solution: ASP.Net MVC app Using Linq-to-SQL with table-per-hierarchy
I am trying my hands on MVC 2, ADO.NET EF and POCO. I have
How can I implement background processing queues in my ASP.NET MVC web app? While
I am trying to deploy a asp.net mvc site. My hosting service provider provides
I am trying to get a simple prototype using ASP.NET S#arp-architecture (Sharp architecture) to
After trying and failing to get my hands on a temporary Mac to develop
I'm trying to integrate NHibernate.Validator with ASP.NET MVC client side validations, and the only
I'm trying get the visible portion of UIImage from an UIImageView . UIImageView takes
I've recently started tinkering with ASP.NET MVC, but this question should apply to classic

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.