Hi, i have this linq to entities query:
c.CreateQuery<T_Hotels>("T_Hotels").Where(item => item.Id > 0).GroupBy(item => new { item.Location, item.Name }).Select(group => new { group.Key, Total = group.Sum(item => item.Id) })
I want to implement everything in a method of a class Helper, how declare the expressions of GroupBy and Select, what return type?
public IQueryable<???> GetHotelsGroupBy(Expression<Func<T_Hotels, bool>> pWhere,
??? pGroupBy, ??? pSelect)
{
return c.CreateQuery<T_Hotels>("T_Hotels").Where(pWhere).GroupBy(pGroupBy).Select(pSelect);
}
Sorry for my English language. Rino