开发者

How to structure my ASP.NET MVC 2 project with Areas sensibly

I want to structure my ASP.NET MVC 2 web application sensibly using Areas. The application consists of the two main parts Website which is the default part and Dashboard which administrates the site using a CMS. (Probably, more Areas will follow later on.)

How do I structure my project best? Should I ...

  1. create the Area Dashboard and put the stuff belonging to the Website part into the main application folder or should I
  2. create both Areas Website and Dashboard?

Additi开发者_运维问答onally, where should I place my Entity Data Model and the corresponding Repository classes that have to be accessed by both Areas?


I would go with option 1. Then your urls would look like this (if you use the default routing):

Website: http://mysite/ Dashboard: http://mysite/dashboard

If you change your mind later on, it's not too difficult to move your website into an area.

As for your "model", I wouldn't bother with the Models folders created by default for an MVC project. I would probably put this in its own project, give it a sensible namespace (mysite.domain or mysite.model) and reference it from the mvc app.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜