I am using RIA services. I need to select a parent entity (UnitOccupier
) which has a number of related child entities(UnitOccupierDetails
). I need to filter the child entities to return a single record. How do I do this?
var q = from uo in _unitOccupierContext.GetUnitOccupierQuery()
where uo.UnitOccupierDetails.????
---> I cant get to the child properties here
Thanks
You cannot include a filtered child collection of the selected parent. You can only include either the full collection or no child collection at all. But as a workaround you could use an intermediate anonymous type, like so:
Edit
If you want to query for the childs and include their parents (related to question in comment) you could use:
I am assuming here that your
UnitOccupierDetails
class has a navigation property to the parentUnitOccupier
.