Solved

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

Posted on 2013-05-29
2
562 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
2 Comments
 
LVL 38

Assisted Solution

by:PaulHews
PaulHews earned 250 total points
Comment Utility
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 250 total points
Comment Utility
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

762 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now