Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

ASP.Net MVC 4 C# -- create good "view-models" ?

Posted on 2013-05-29
2
Medium Priority
?
590 Views
Last Modified: 2013-06-02
I currently do the below four steps to create a simple app.

Does anyone have a good URL (besides the below)
talking about how to create good "view-models" ?
-------------------------------------------------------------
http://geekswithblogs.net/michelotti/archive/2009/10/25/asp.net-mvc-view-model-patterns.aspx
http://www.howmvcworks.net/OnModelsAndViewModels/ToModelOrViewModel
http://en.wikipedia.org/wiki/Model_View_ViewModel
http://stackoverflow.com/questions/8151073/use-of-attributes-on-properties-in-mvc-3-edmx-model

 1. create new APP
 2. RMB on Models FOLDER, Add, ADO.NET Entity Data Model
      ** Server = DBTEST
      ** Database = MVC_test (make sure table has "PK=ID" so Edit, Details, Delete work
 3. REBUILD
 4. RMB on Controllers FOLDER, Add, Controller, Default1Controller
      ** Template = MVC with read/write actions and views, using Entity Framework
      ** Model Class = Table6 (MvcApplication14.Models)
      ** Data Context Class = MVC_testEntities (MvcApplication14.Models)
0
Comment
Question by:finance_teacher
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 38

Assisted Solution

by:PaulHews
PaulHews earned 1000 total points
ID: 39206091
There are many ways to do this, and many opinions on what is the best way.

A good link on designing viewmodels:
http://lostechies.com/jimmybogard/2009/06/30/how-we-do-mvc-view-models/

Here is a possibly useful tool for mapping viewmodel back into domain
http://bengtbe.com/blog/2009/04/14/using-automapper-to-map-view-models-in-asp-net-mvc/

Discussion of best practices
http://stackoverflow.com/questions/664205/viewmodel-best-practices
0
 
LVL 19

Accepted Solution

by:
Manoj Patil earned 1000 total points
ID: 39206773
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question