BT

New Early adopter or innovator? InfoQ has been working on some new features for you. Learn more

WCF Data Services 5.6.0 Adds Entity Framework 6 Support

| by Anand Narayanaswamy on Oct 08, 2013. Estimated reading time: 1 minute |

Microsoft has released WCF Data Services 5.6.0 as a NuGet package with support for Entity Framework 6+ and should be used in addition to the EntityFramework and Microsoft.Data.Services NuGet packages.

In order to create a new OData service with Entity Framework 6 you should make use of a ASP.NET Empty Web Application, create an App_Data folder, install WCF Data Services Entity Framework Provider NuGet package and add a new WCF data service. You will be required to upgrade other NuGet packages in your project since the latest release depends upon EF6.

Finally, replace the base type of the DataService that was generated by the item template. If you make use of EF 6 then your data service should inherit from EntityFrameworkDataService<T> where T is a DbContext.

In order to install WCF Data Services Entity Framework Provider run the following command in the Package Manager Console

PM> Install-Package Microsoft.OData.EntityFrameworkProvider -Version 1.0.0-alpha1 -Pre

You can also upgrade an existing OData service to EF 6 by replacing the base type of your DataService and should inherit from EntityFrameworkDataService<T> where T is a DbContext.

The official blog post of the OData product team examines the key difference between DataService<T> and EntityFrameworkDataService<T>.

 

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and dont miss out on content that matters to you

BT