Tuesday, 28 October 2014

Error with Entity Framework 6 after importing Stored Procedures & Functions

I have recently started using Entity Framework 6 for my VS2012 project in 4.5 framework. I was confronted with an error after importing Stored Procedures & Functions, which I did much later after importing the tables.

cannot convert from 'System.Data.Objects.ObjectParameter' to 'System.Data.Entity.Core.Objects.ObjectParameter'

The issue may have arisen because I had used EF5 in my previous project. The solution that I figured out is quite simple. We need to replace

using System.Data.Objects;
 
with
 
using System.Data.Entity.Core.Objects;

No comments: