Can you use the Entity Framework directly from Silverlight?
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 th开发者_开发知识库e 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?
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.
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.
精彩评论