What I want to do is a group by in my linq query, but I do not really know what the correct syntax is so that it gets it right:
Current Code:
public List<Section> getSectionsClass()
{
var context = GetDbContext();
return (from cs in context.contenido_seccion
join c in context.clase on cs.materiaId equals c.materiaId
group cs by cs.id into gr
select new Section()
{
Name = cs.nombre,
Id = cs.id,
IdClass = c.id
}
).ToList();
}
I get an error after gr
in select
and the error says as follows:
Ambiguos invocation