Was DbExtensions lib not included for EF 6.0? I have a generic repo that returns and IQueryable and I'd like to be able to call .Include(i => i.SomeEntity) on demaind when needed.
I'm going to answer my own question. You don't make a reference to System.Data.Entity for version 6 to get the DbExtensions. You need to reference the EntityFramework itself and add using System.Data.Entity at the top of your cs file and the .Include() will be there.
For EF 6.0 these functions are now available in System.Data.Entity.QueryableExtensions
within EntityFramework.dll
:
public static IQueryable Include(this IQueryable source, string path);
public static IQueryable<T> Include<T>(this IQueryable<T> source, string path);
public static IQueryable<T> Include<T, TProperty>(this IQueryable<T> source, Expression<Func<T, TProperty>> path);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With