Search code examples
c#.netentity-frameworkwcf-data-services

Setting up EntityFramework 6 and WCF Data Services 5.6


I'm trying to setup a project for Entityframwork 6 and WCF Data Services 5.6. I went through this page

I installed NuGet package By:

Install-Package Microsoft.OData.EntityFrameworkProvider -Pre

After That I tried to ADO.Net Entity Data Model using Wizard. It doesn't allow me to Go futher. Error is like this

Your Project references the latest version of E F; However and EF database provider comapatible with this version could not be found for your data connection. Exit this wizard, install ta compatible provider, and rebuild your project before performing this action. and a link : http://msdn.microsoft.com/en-us/data/jj730568

My database is Oracle 11g and I'm using DevArt whose version is Oracle pro 8.0.146.0

I thought it is some issue with DotConnect I checked with vendor they gave me this link

I followed this too. But no success.

When I try adding DevArt Data Model *edml it gives me Ef 6 too. so when Create this edml and try a WCF Data Service give me The exception message is:

The property 'EntityState' on type 'Models.USER' is not a valid property. Make sure that the type of the property is a public type and a supported primitive type or a entity type with a valid key or a complex type.'. See server logs for more details. The exception stack trace is: at System.Data.Services.Providers.ReflectionServiceProvider.BuildTypeProperties

How can I set these up together?


Solution

  • Entityframework 6 , WCF Data Service 5.6 , DevArt oracle Connector

    Now Let me Ans for my questions itself.

    1. Entityframework 6 & WCF Data Serice was not working from Day 1. Why complex dependencies of EF 6 & Data Services 5.6.
    2. DevArt Entity Wizard Create the Entities Data model with EntityObject which I don't why still why doesn't work with DataService.

    So I followed Below mentioned Links like Final words http://blogs.msdn.com/b/odatateam/archive/2013/10/02/using-wcf-data-services-5-6-0-with-entity-framework-6.aspx?Redirected=true

    1. created a fresh Blank MVC Project for DataService 5.6
    2. Install EF 6 with NuGet Package manager.
    3. installed Install-Package Microsoft.OData.EntityFrameworkProvider -Version 1.0.0-alpha2
    4. Create DataModel with DevArt EntityWizad for EF 6 choose DbContext Template (Don't why it still write the code with Both ObjectContext , DbContext
    5. Remove Manually ObjectContext Auto Generated Code.
    6. Add WCF data Service 5.6 For wizard
    7. Change DataService to EntityFrameworkDataService
    8. Register Entity Provider http://blog.devart.com/entity-framework-6-support-for-oracle-mysql-postgresql-sqlite-and-salesforce.html

      believe me complex dependecy of dll is the hurdle to cross. For more you please read below threads. (Oopps.. I've not Reputation here so I can't post more links. Sorry)