Given a EF-Code First CTP5 entity layout like:
public class Person
{
public List<Children> Childrens { get; set; }
}
and
public class Children
{
public int Age { get; set; }
}
I want to do:
PersonQuery.Include(x => x.Childrens.OrderByDescending(child => child.Age).Take(3))
and get only 3 older childrens from list.
for example:
I got Person with 5 childrens ages 5, 10, 15, 20, 25
I want select the person + list of 3 childrens ages 25, 20, 15.
this is the error I have:
The Include path expression must refer to a navigation property defined on the type. Use dotted paths for reference navigation properties and the Select operator for collection navigation properties. Parameter name: path