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

when creating the Entity ADO.net data model then create this error

how to solve this error.

Error 66 Argument 10: Cannot convert from "System.Data.Objects.ObjectParameter" to "System.Data.Entity.Core.Objects.ObjectParameter" D: \ Aziz \ Aziz Project \ Development \ Running Development \ Web \ pos \ pos \ Model1.Context.cs 351 278 pos

how to solve this error.

+6
source share
2 answers
using System.Data.Object; using System.Data.Objects.DataClasses; 

Replace for:

 using System.Data.Entity.Core.Objects; using System.Data.Entity.Core.Objects.DataClasses; 
+19
source

This is one of the most common compile-time errors you may encounter in the Entity Framework. This is because either of:

  • Version conflict or
  • The namespace is used.

    By default, when compiling a project, the framework includes a namespace using System.Data.Objects;

Decision:

To fix this problem:

If version conflicts, install the package for the appropriate version of EF.

If the version is the same, change the specified namespace to System.Data.Entity.Core.Objects

+8
source

Source: https://habr.com/ru/post/988316/


All Articles