WebService的实体框架 [英] Entity Framework to WebService

查看:61
本文介绍了WebService的实体框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始以ORM的身份使用Entity Framework。但是我的问题是:在Entity Framework和WebServices之间映射实体是否正确?

I'm starting to work with Entity Framework as ORM. But my question is: is it correct and possible to map entities between Entity Framework and WebServices?

问题是因为我们需要从Web服务中查询数据(方法)到我们的应用程序,我们还需要使用一个Web服务(方法)来存储数据;因此,我们希望保持整个应用程序的体系结构(使用企业库查询和存储的所有内容)。

The question is because we need to query data from a web service (method) to our application, and also we need to consume a webservice (method) to store data; so we want to keep the architecture along the whole application (everything queried and stored using Enterprise Library).

希望我已经说清楚了,在此先感谢,如果可能的话,请给我一些入门的有用信息或教程。

Hope I made myself clear, thanks in advance and if it's possible, give me please some useful information or tutorial for starters.

推荐答案

在网络上进行深入搜索后,我发现了答案我的问题是:不仅不能将实体从Web服务映射到Entity Framework(至少,不像使用数据库表那样容易),而且也不应该这样做;因为WebService并非旨在用于此目的,所以它仅公开整个数据的某些成员,因此仅对数据实体本身的某些部分应用EF结构是不合逻辑的。

Doing a deep search on the web, I found out that the answer to my question is: "Not only you can't map entities from a web service to Entity Framework (at least, not as easily as it would be with a database table), but also you shouldn't do it"; because a WebService was not intended for that purpose, it only expose certain members of the whole data, so it's not logical to apply EF structure for only certain part of the data entity itself.

如果有人有同样的疑问,这是原始帖子:

Here is the original post if anybody have the same doubt:

MSDN论坛-使用实体框架映射Web服务

这篇关于WebService的实体框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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