ASP.NET MVC和放大器;网页服务 [英] ASP.NET MVC & Web Services

查看:144
本文介绍了ASP.NET MVC和放大器;网页服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否添加Web服务到我的ASP.NET MVC项目打破MVC的整个概念?

Does adding a Web Service to my ASP.NET MVC project break the whole concept of MVC?

这是Web服务(WCF)取决于从我的MVC项目与后端通信模型层(所以它看起来对我来说,它需要的MVC解决方案的一部分)。

That Web Service (WCF) depends on the Model layer from my MVC project to communicate with the back-end (so it looks to me like it needs to be part of the MVC solution).

我应该将其添加到控制器或模型层?

Should I add this to the Controller or Model layer?

推荐答案

这听起来像你应该模型拆分为自己的组装和从你的MVC应用程序和WCF应用程序引用它。

It sounds like you should split out your model into its own assembly and reference it from your MVC-application and WCF-application.


  • YourApp.Data - 共享的模型和数据访问也许

  • YourApp.Web - 如果你想分享整个网络的应用更加

  • YourApp.Web.Mvc

  • YourApp.Web.WebService

如果你想要做的WebServices MVC风格也许你应该使用MVC构建自己的REST的应用程序。

If you want to do WebServices MVC-style maybe you should use MVC to build your own REST-application.

这篇关于ASP.NET MVC和放大器;网页服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆