开发者

Asp.net MVC 3 and NHibernate Architecture

I setup a solution with the following structure:

  • Project.Core

    • Domain

    • Mappings

    • Repositories

    开发者_Go百科
  • Project.Web

    • Views

    • Models

    • Contollers

Project.Web is the asp.net MVC 3 template. I was wondering what would be the best architecture would be if i'm using MVC and NHibernate and I wont other web applications to utilize the Project.Core library.

It seems like the Domain and the Models are pretty much the same thing?

If I want to use the Domain's instead of the model how would I modify the asp.net mvc3 project to accept this?

Thanks


Yes, your domain objects in Project.Core are the same as your models. Just delete your Models folder in Project.Web and create a project reference from Project.Web to Project.Core. Since Project.Core is simply a Class Library project and contains your domain model, repositories, and mappings*, you can use these classes from Project.Web, a console app, web service, or any other code.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜