简体   繁体   English

我可以使用Entity Framework for Web服务的非DB结果吗?

[英]Can i use Entity Framework for Non-DB results from a web service?

I am working on a project where different data is presented via a set of web services. 我正在一个项目中,该项目通过一组Web服务显示不同的数据。 These web services are a front end to MS Dynamics CRM. 这些Web服务是MS Dynamics CRM的前端。 What the services are returning is essentially a class that has an Entity (a CRM Entity) in a paged data wrapper. 服务返回的本质上是一个在页面数据包装器中具有Entity(CRM实体)的类。

[DataContract]
public class PagedData<T>
{
    [DataMember(EmitDefaultValue=true)]
    public T[] Items { get; set; }
    [DataMember(EmitDefaultValue=true)]
    public int PageNumber { get; set; }
    [DataMember(EmitDefaultValue=true)]
    public int PageSize { get; set; }
    [DataMember(EmitDefaultValue=true)]
    public int TotalCount { get; set; }
}

My app will use a web page with drop down lists to fill in the values that will go into these services. 我的应用程序将使用带有下拉列表的网页来填写将用于这些服务的值。 At the same time, I will be retrieving data to populate the drop down lists via these services. 同时,我将通过这些服务检索数据以填充下拉列表。

I've seen articles on here about producing web services using Entity Framework, including links to here , but i have not seen much on consuming into or using Entity Framework to create a facade to a web service. 我在这里看到了有关使用Entity Framework生产Web服务的文章,包括到here的链接,但是在使用或使用Entity Framework创建Web服务的外观方面并没有看到太多。

Any ideas what i should do? 有什么想法我应该做什么?

Entity Framework works on any Data source that has a " EntityFramework provider" 实体框架可用于具有“ EntityFramework提供程序”的任何数据源

EF providers EF提供者

Providers for major Databases are available. 可以使用主要数据库的提供程序。

If the source data in memory Objects, then there is no need to Use EntityFramework. 如果源数据在内存对象中,则无需使用EntityFramework。 You can simply use LInq to the in memory lists/collections. 您可以简单地使用LInq进入内存中的列表/集合。

So your web page can make a WCF call to get a result. 因此,您的网页可以进行WCF调用以获得结果。 This result can be accessed in memory when it returns. 返回结果可以在内存中访问。 I see no need for EF in that scenario. 我认为在这种情况下不需要EF。 Just LINQ away 距LINQ仅几步之遥

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM