简体   繁体   English

为什么Silverlight 4将WCF RIA服务用于Entity Framework?

[英]why Silverlight 4 uses WCF RIA service for Entity Framework?

I want to use Entity framework in silverlight , But with out RIA service . 我想在Silverlight中使用实体框架,但是没有RIA服务。

Is there any way ? 有什么办法吗?

If WCF RIA is mandatory than why so ? 如果WCF RIA是强制性的,为什么呢?

Silverlight is a client side runtime (Code is not executed on the server). Silverlight是客户端运行时(服务器上未执行代码)。 And therefore you cannot use Entity Framework to call a DB directly from it. 因此,您不能使用实体框架直接从中调用数据库。 RIA Services essentially create a web service layer that Silverlight can talk to. RIA Services本质上创建了Silverlight可以与之交谈的Web服务层。 On the client side proxy classes are created to interact with the service layer. 在客户端,创建代理类以与服务层进行交互。 RIA Data Services is designed to make it appear as if you are interrogating EF directly. RIA数据服务旨在使它看起来像您在直接询问EF一样。

To use EF without RIA services you can create a basic service class and have all your business logic in it, and from within this service you can use Entity Framework. 要在没有RIA服务的情况下使用EF,您可以创建一个基本服务类并在其中包含所有业务逻辑,并且可以从该服务中使用实体框架。 You would make calls to this service layer just like any other service. 您将像其他任何服务一样调用此服务层。

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

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