The Include path expression must refer to a navigation property defined on the type

前端 未结 1 1052
野的像风
野的像风 2021-01-01 12:41

I have the following Repository method:-

public AccountDefinition GetCustomer2(int id)
{
    var c = entities.AccountDefinitions
            .Where(p=>p.O         


        
相关标签:
1条回答
  • 2021-01-01 13:01

    I think you may want to do something like

    public AccountDefinition GetCustomer2(int id)
            {
    
                var c = entities.AccountDefinitions.Where(p=>p.ORG_ID==id)
                    .Include(a => a.SDOrganization)
                    .Include(a2 => a2.SiteDefinitions)
                    .Include(a3 => a3.SDOrganization.AaaPostalAddresses)
                    .Include(a4 => a4.SiteDefinitions.Select(a5 => a5.DepartmentDefinitions.Select(a6 => a6.SDUsers.Select(a7 => a7.AaaUser))));
    
                return c;
            }
    
    0 讨论(0)
提交回复
热议问题