我如何使用与MVC3(剃刀)模型WCF的参考? [英] How do I use WCF reference with MVC3 (razor) model?
本文介绍了我如何使用与MVC3(剃刀)模型WCF的参考?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个 WCF服务
和 MVC3
(剃刀)网站。我所有的数据来自 WCF服务
。
我有我的控制器和意见,但是,我怎么使用模型这种结构?
I have a WCF Service
and a MVC3
(razor) web site. All my data comes from the WCF Service
.
I have my controllers and views but, how do I use the model with this structure ?
现在,我把我的方法,从与服务 DataController类
和我打电话给他们的控制器。
for now, I call my method from the service with a DataController
and I called them in the Controllers..
更好的解决方案吗?
推荐答案
你想从你的模型访问WCF服务?哎哟...
Do you want to access a WCF service from your Model? Ouch...
坚持到控制器。控制器与服务交互,车型则没有。
Stick to the Controller. Controllers interact with services, models don't.
这篇关于我如何使用与MVC3(剃刀)模型WCF的参考?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文