使用ASP.net MVC时,我应该如何设置我的解决方案?

时间:2021-08-05 03:31:12

When using ASP.net webforms my usual solution would have following type of setup -

当使用ASP.net webforms时,我的常用解决方案将具有以下类型的设置 -

  1. MyCompany.MyProject.Presentation.MyWebFormsApp (asp.net web forms )
  2. MyCompany.MyProject.Presentation.MyWebFormsApp(asp.net web forms)

  3. MyCompany.MyProject.Service.MyServieLayer (WCF/Web Service)
  4. MyCompany.MyProject.Service.MyServieLayer(WCF / Web服务)

  5. MyCompany.MyProject.Business.MyBusinessLogicLayer (class project)
  6. MyCompany.MyProject.Business.MyBusinessLogicLayer(类项目)

  7. MyCompany.MyProject.DataAccess.MyDALayer (class project/Linq2SQL/NHibernate == DataModel)
  8. MyCompany.MyProject.DataAccess.MyDALayer(类项目/ Linq2SQL / NHibernate == DataModel)

  9. MyCompany.MyProject.DataTransferObjects.MyDomainLayer (class project)
  10. MyCompany.MyProject.DataTransferObjects.MyDomainLayer(类项目)

  11. {whole bunch of test projects}
  12. {全套测试项目}

When using ASP.net MVC, I have used this kind of solution breakdown -

当使用ASP.net MVC时,我使用了这种解决方案 -

  1. MyCompany.MyProject.Presentation.MyMVCApp (ASP.net MVC project)
  2. MyCompany.MyProject.Presentation.MyMVCApp(ASP.net MVC项目)

  3. MyCompany.MyProject.DataAccess.MyDALayer (class project/Linq2SQL/NHibernate == DataModel)
  4. MyCompany.MyProject.DataAccess.MyDALayer(类项目/ Linq2SQL / NHibernate == DataModel)

  5. {whole bunch of test projects}
  6. {全套测试项目}

Question In an AP.net MVC setup how do I wire up my DomainObjects/DTO/POCO and the WCF/Web Service layers?? Do I lose out on any features if I want to keep the solution like I used for WebForms??

问题在AP.net MVC设置中,如何连接我的DomainObjects / DTO / POCO和WCF / Web服务层?如果我想保留像我用于WebForms的解决方案,我会失去任何功能吗?

1 个解决方案

#1


The ASP.NET MVC project should only differs in Web Project, everything else should remain the same. In web project the regular page you have in Web forms application will now split into controller and view.

ASP.NET MVC项目应该只在Web Project中有所不同,其他一切应该保持不变。在Web项目中,Web表单应用程序中的常规页面现在将拆分为控制器和视图。

#1


The ASP.NET MVC project should only differs in Web Project, everything else should remain the same. In web project the regular page you have in Web forms application will now split into controller and view.

ASP.NET MVC项目应该只在Web Project中有所不同,其他一切应该保持不变。在Web项目中,Web表单应用程序中的常规页面现在将拆分为控制器和视图。