2

I'm creating a scaffold controller in MVC with Entity Framework. my model contains a navigation property and i expect to get eager loading for this property in the generated controller. and i get exactly what I expects, but there is an error to ambiguous call in

var courses = db.Courses.Include(c => c.Department);

the error details

The call is ambiguous between the following methods or properties: 'System.Data.Entity.QueryableExtensions.Include(System.Linq.IQueryable, System.Linq.Expressions.Expression>)' and 'System.Linq.EntityFrameworkQueryableExtensions.Include(System.Linq.IQueryable, System.Linq.Expressions.Expression>)

any help will be appreciated

Mohamed Badr
  • 2,562
  • 2
  • 26
  • 43

1 Answers1

0

Thanks to @GertArnold as he gave me a clue

EF7 was installed and replaced with EF6, but i think that some refrenced dll wasn't comletely removed so i uninstalled EF6 and manulaly deleted all dll files related to entity framework also deleted any refrenced file related to EF in the project then reinstaleed EF6 again and it works fine

Community
  • 1
  • 1
Mohamed Badr
  • 2,562
  • 2
  • 26
  • 43