18

I am a bit confused on why I don't get linq.

context.Users.Include(x => x.Roles)

I can't do this I have to do context.Users.Include("Roles")

Seems like other people can do it.

EF Code first Eager loading and OrderBy problem

Do I need to import something? Has something changed in EF 6(rc1)?

Community
  • 1
  • 1
chobo2
  • 83,322
  • 195
  • 530
  • 832

1 Answers1

60

If you're using DbContext, the correct namespace to import is:

using System.Data.Entity;

This is the namespace that contains DbExtensions that provides the type-safe versions of the .Include method.

Kirk Woll
  • 76,112
  • 22
  • 180
  • 195