What is wrong with this query?
var model =
SessionObjectsMSurvey.ContractList
.Where(y => y.ContractTitle.ToUpper().Contains(upper))
.GroupBy(g => new
{
g.BriefTitle,
g.ContractId
})
.Select(
x => new
{
label = x.BriefTitle,
id = x.ContractId.ToString()
}).Take(20);
SessionObjectsMSurvey.ContractList is an IEnumerable collection.
This won't compile, I get;
Error 13 'System.Linq.IGrouping' does not contain a definition for 'BriefTitle' and no extension method 'BriefTitle' accepting a first argument of type 'System.Linq.IGrouping' could be found (are you missing a using directive or an assembly reference?)