Solved

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

Posted on 2013-05-29
2
582 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 250 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 250 total points
ID: 39206773
0

Featured Post

Create CentOS 7 Newton Packstack Running Keystone

A bug was filed against RDO for the installation of Keystone v3. This guide is designed to walk you through the configuration for using Keystone v3 with Packstack. You will accomplish this using various repos and the Answers file.

Question has a verified solution.

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

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

632 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