Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>There are no good place to keep your models in. You can keep them in separate assembly if the project is big and there are a lot of ViewModels (Data Transfer Objects). Also you can keep them in separate folder of the site project. For example, in <a href="http://www.codeplex.com/oxite" rel="noreferrer">Oxite</a> they are placed in Oxite project which contains a lot of various classes too. Controllers in Oxite are moved to separate project and views are in separate project too.<br> In <a href="http://code.google.com/p/codecampserver/" rel="noreferrer">CodeCampServer</a> ViewModels are named *Form and they are placed in UI project in Models folder.<br> In <a href="http://www.codeplex.com/mvcpress" rel="noreferrer">MvcPress</a> project they are placed in Data project, which also contains all code to work with database and a bit more (but I didn't recommend this approach, it's just for a sample)<br> So you can see there are many point of view. I usually keep my ViewModels (DTO objects) in the site project. But when I have more than 10 models I prefer to move them to separate assembly. Usually in this case I'm moving controllers to separate assembly too.<br> Another question is how to easily map all data from model to your ViewModel. I suggest to have a look at <a href="http://www.codeplex.com/AutoMapper" rel="noreferrer">AutoMapper</a> library. I like it very much, it does all dirty work for me.<br> And I also I suggest to look at <a href="http://code.google.com/p/sharp-architecture/" rel="noreferrer">SharpArchitecture</a> project. It provides very good architecture for projects and it contains a lot of cool frameworks and guidances and great community.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload