I have the following entity structure:
public class Party
{
public Int32 PartyId { get; set; }
public List<PartyRelationship> RelationShips { get; set; }
}
public class PartyRelationship
{
public Int32 PartyId { get; set; }
public Int32 RelatedPartyId { get; set; }
}
Now, if I create a general list of Party objects, such as List, how can I write a LINQ query to a list that will return all PartyRelationship objects that are related to a specific PartyId based on RelatedPartyId? A LINQ query would have to evaluate the Associated PartyId of all the relationships defined for the Party and compare them with the specific PartyId that I am looking for. When a match is found, I want the specific PartyRelationship object returned as a result. By the way, there may be several coincidences.
Can someone give an idea of โโhow I can do this?
Any help would be appreciated.
thanks
Kevin source
share