BT

InfoQ Homepage News WCF Data Services 5.6.0 Adds Entity Framework 6 Support

WCF Data Services 5.6.0 Adds Entity Framework 6 Support

Bookmarks

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
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.

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

Community comments

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

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

BT

Is your profile up-to-date? Please take a moment to review and update.

Note: If updating/changing your email, a validation request will be sent

Company name:
Company role:
Company size:
Country/Zone:
State/Province/Region:
You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.