简体   繁体   中英

Silverlight and Entity Framework

is is possible to use full Entity Framework 4+ in Silverlight? I use it with WPF, but is there any difference when using Silverlight?

Thank you!

Not on a client side. In Silverlight world client talks to server via WCF services. Then, server side can use anything you want and EF perfectly fine.

RIA, MVVM and such are just "gluing" techniques that allow you to use WCF in most easy way on client side.

The short answer to your question is No, your Silverlight app is a client app and is abstracted from your server side just like an aspx page is until its gets posted back to the server. You need to use a service to access data / EF on the server. There are a number of patterns to consider when doing this, I suggest you read up a bit before jumping in. If you expected it would be quick to convert a WPF app to Silverlight I would suggest you slowdown a bit and read up about it (I didn't, and I should have). If your WPF app used services (which I assume it doesn't as you seem to be using EF in the WPF app) it would have been much easier to share the code but there are a number of things to consider, its way more than just sharing xaml views. With Silverlight finding a good pattern for your application is essential, and MS has lots of it

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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