I have two entities. One is \"Students\" while another is \"Subjects\".
The details of the two entities is something like:
students { id, name} subject
This means that you need to name your anonymous type's properties that cannot be inferred
select new { s.name, Count=s.subjects.Count(i => i.passed.Equals(true)) };
Usually, the property name is good enough, however you are using the Count method, so that property has no inherent name