Models in asp.net mvc 3 area

How to organize models in several areas? I am trying to organize code using areas. I am using visual studio 2010 express , the project is on asp.net mvc3 and with code development . All tutorials and Internet links only talk about controllers and routes, but what about models? more precisely, I am looking for offers around:

  • The model folder in the area will contain its own classes, so where should dbcontext be located? I already have a dbcontext class containing several dbset entries in the root folder. Can I have several dbcontext saving their data in one database?
  • I went through the asp.net mvc portable area mvccontrib project, but its still in asp.net mvc2, but is this the only way to create plugins / components in asp.net mvc 3?
  • Besides areas / portable zones, is there a better way to organize the code in such a way that new functions can simply be "dropped" without too much change in the existing code? The zones look but I can’t understand how the models should fit.
  • Are areas useful only for controlling the controller and viewing?
+2
source share
3 answers
  • dbcontext , . , . ! dbcontext, db.

  • .

  • , , //. , , .

  • , , , , ? mantra: 4 : View/Model/ViewModel/Controller.

...

0

DbContext , , , dbcontext -. Model-First. dbinitializers , , . , DbModelBuilder, orchard CMS . - ? , ...

0
  • .

The area registration code is a good hint about which areas are used to - separate routes and access specific controllers. (Think UI logical units). Namespaces are the preferred tool for organizing your code.

Perhaps look at something like Umbraco, Orchard, or even N2CMS to find out how they manage extensions.

0
source

All Articles