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 generic list of Party objects, such as List, how can I write a LINQ query against the list that will return all of the PartyRelationship objects that have a relationship to a specific PartyId based on the RelatedPartyId? The LINQ query would need to evaluate the RelatedPartyId of all relationships defined for a Party and compare that against a specific PartyId that I am searching for. When a match is found, I would want that specific PartyRelationship object return in the result. BTW, more than one match can occur.
Can anyone provide some insight into how I could do this?
Any help would be appreciated.
Thanks