1

I've got these Classes:

class Family()
{
 public int Id {get; set;}
 public List<Person> members {get; set;}
}

class Person()
{
 public int Id {get; set;}
 public List<Items> items {get; set;}
 public List<Person> friends {get; set;}
}

How can I get a Family with all their Persons and these persons should be populated with all their items and friends in one query?

This doesnt work:

(from f in fcontext.families
where f.Name == "Schmidt"
select f).Include("members.items").Include("members.friends").ToList();

Someone said that this is a possible duplicate, but its not, I'm having an exception when I try that.

I'm using MySQL Entity Framework Provider as the database behind is a MySQL DB. That throws this exception each time i have multiple includes:

Unknown column 'Join1.Id1' in 'on clause'.

Ravior
  • 561
  • 2
  • 9
  • 30
  • Possible duplicate of [EF LINQ include multiple and nested entities](http://stackoverflow.com/questions/15764572/ef-linq-include-multiple-and-nested-entities) – Daniel Persson Oct 28 '16 at 11:15
  • 2
    Nope its not, Im talking about MySQL provider for entity framework. Multiple includes dont work, it either throws an exception "Method not implemented" or has an exception like "column not found" referring to query-generated columns where i have no access to. – Ravior Oct 28 '16 at 19:18
  • Please give the exact exception message. – Gert Arnold Oct 28 '16 at 20:03
  • Theres an Exception that sais that another module threw an exception. In its inner exception theres just simply that string I posted: Unknown column 'Join1.Id1' in 'on clause'. – Ravior Oct 28 '16 at 22:21
  • 1
    Did you found the solution for this ? i am also having same issue. – Anchit Pancholi Dec 05 '17 at 21:36

0 Answers0