views:

268

answers:

2

Every example I see of data access in Silverlight seems to be using the RIA Services to get hold of the entities from the back end. Is it possible to use the Entity Framework directly from Silverlight or is that impossible and hence the need to use RIA Services instead?

It would seem that using the Entity Framework directly from Silverlight against a SQL Azure database was a much more efficient and flexible way of handling data than going via the extra layer of RIA Services. What am I missing here?

+4  A: 

No, Silverlight has no direct database access at the moment and I don't believe it's planned. You can use RIA services or plain old ADO.NET Data Services.

Josh Einstein
+3  A: 

You can't use Entity Framework directly in Silverlight for the simple reason that you are working on the client side at runtime.

While using EF emphasis that you have access to your database which you should don't grant to a client-side runtime.

The best solution so far is to use the RIA Services which provide an intuitive and transparent way to manipulate your data and very similar to the EF.

Zied
Thanks, that makes more sense. I was wondering about the security aspect. Guess I will have to investigate RIA services then.
Phil Wright