public class Denial
{
[Key]
public string DenialCd { get; set; }
[Required]
public string DenialDesc { get; set; }
public ICollection<CaseDenial> CaseDenials { get; set; }
}
public class CaseDenial
{
[Key]
public int ID { get; set; }
[Required]
public string DenialCd { get; set; }
[Required]
public int CaseId { get; set; }
[ForeignKey("DenialCd")]
public Denial Denial { get; set; }
[ForeignKey("CaseId")]
public Case Case { get; set; }
}
var query = EntityQuery.from('CaseDenials')
.where("CaseId", "==", caseID)
.expand("Denial")
.orderBy("DenialCd").inlineCount();
CaseDenial table links to DenialCd column of Denial table. Above breeze query brings null for the navigation property "Denial" while fetching records from CaseDenials.