くだらないタイトルでごめんなさい。コレクションを照会し、孫のプロパティに基づいて祖父母、親、孫を返す必要があります
たとえば、以下のオブジェクトでは、条件がプランの ID と一致する場合にのみ、Quote、Rate (Parent)、および Plan (GrandChild) を取得したいと考えています。
public class Quote
{
public int Id { get; set; }
public string Type { get; set; }
public string ParentType { get; set; }
public decimal ValueMax { get; set; }
public virtual ICollection<Rate> Rates { get; set; }
}
public class Rate
{
public int Id { get; set; }
public decimal ValueMax { get; set; }
public ICollection<Plan> Plans { get; set; }
}
public class Plan
public int Id { get; set; }
public decimal Price { get; set; }
}