I want to convert this to a generic type:
using System.Linq.Expression
using System.Collections.Generic
public IQueryable<T> AllIncluding(
params Expression<Func<T, object>>[] includeProperties)
{
IQueryable<T> query = All;
foreach (var includeProperty in includeProperties)
{
// query = query.Include(includeProperty);
}
return query;
}
But it doesn’t seem to work, how would i do this?
The
Includemethod is available only onDbQuery<T>so you have to cast the query to it using a direct cast or theasoperand or use the method DbExtensions.Include: