Reputation: 357
Is it possible to use oData as a datasource for entity framework? We are looking at the possibility of our web app calling a wcf method that would return oData for our entites generated by entity framework 4.2. I'm wondering if this was possible and if so how I would go about doing it.
Any advice would be much appreciated!
Upvotes: 2
Views: 471
Reputation: 364279
If you consume OData (with WCF Data Services) you will already get context and generated entities. Just add service reference to OData service and it should generate all entities and client for you.
OData is not valid data source for EF. EF is ORM for communication with database provider. You are looking for provider transforming .NET calls (and LINQ queries) into OData protocols - that is what WCF Data Services are supposed to do.
Upvotes: 2