WCF服务与asp.net MVC应用程序 [英] WCF Service with asp.net mvc application
问题描述
我已经使用asp.net MVC开始和传统的方式,我想保持我的数据访问层WCF服务。我怎样才能做到这一点使用asp.net MVC?
I have started using asp.net MVC and as traditional way I want to keep my data access layer in WCF service. How can I achieve that using asp.net MVC ?
场景
我开始在asp.net MVC的测试应用程序,它显示,插入和编辑数据。
我成功地创建,通过添加ADO.Net实体数据模型。
I started a test application in asp.net MVC which Displays, Inserts and Edit data. I successfully created that by adding 'ADO.Net Entity Data Model'.
所以,现在,如果我想在移动WCF服务这个数据访问层,即像的GetData()的UpdateData(),CreateNewData()方法的一个WCF服务,我怎么能做到这一点?
So now if I wanted to move this dataaccess layer in WCF service, i.e. a WCF service with methods like GetData(), UpdateData(), CreateNewData(), how can i achieve that?
推荐答案
答案很简单:
您只需要你的数据访问层移动到一个WCF服务,揭露它,然后从你的MVC应用程序调用它。
You just need to move your dataaccess layer into a WCF service, expose it and then call it from your MVC application.
龙答:
1)我建议通过斯科特·格思里的<一去href=\"http://weblogs.asp.net/scottgu/archive/2009/04/28/free-asp-net-mvc-nerddinner-tutorial-now-in-html.aspx\">Nerd晚餐演练获得MVC基础知识的一个很好的理解。
1) I recommend going through Scott Guthrie's Nerd Dinner walkthrough to get a really good understanding of MVC basics.
2)以下博客经过与WCF服务(第III&放写分层ASP.NET MVC应用程序了进程;四,特别专注于WCF和放大器; MVC交互):
2) The following blog goes through the process of writing a Layered ASP.NET MVC Applicaiton with a WCF Service (Parts III & IV specifically concentrate on WCF & MVC interaction):
- Part I (General Concepts)
- Part II (Building a Repository)
- Part III (Building The Service)
- Part IV (Using The Service)
我还没有仔细阅读(只是脱脂他们)链接arrticles但他们似乎给过程的体面的概述。
I haven't read the linked arrticles in detail (just skimmed them) but they seem to give a decent overview of the process.
这篇关于WCF服务与asp.net MVC应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!