Edit: Updated test-based problem description September 12, 2011
I have this request that throws a NotSupportedException exception ("The specified method is not supported") whenever I call .ToList ().
IQueryable<FileDefinition> query = db .FileDefinitions .Include(x => x.DefinitionChangeLogs) .Include(x => x.FieldDefinitions.Select(y => y.DefinitionChangeLogs))
If I comment on any line that I commented as “bad,” then the query works. I also tried to include various nested objects in my object model with the same effect. Turning on any 2 will crash. By nested, I mean the navigation property of the navigation property. I also tried using .Include methods with a string path: same result.
My table structure is as follows:


It uses MySQL 5.1 (InnoDB tables, obviously) as a database repository with MySQL Connector / NET 6.3.4.
So my question is: why does this not work?
Note. I can make it work if I explicitly load related objects, for example, into this link . But I want to know why EF hates my data model.
ANSWER: The MySQL Connector is apparently not capable of handling the second nested object. It throws a NotSupportedException, not a .NET EF. The same error was also present when I tried it using EF4.0, but my research at that time led me to think that these were self-monitoring objects that caused the problem. I tried updating to the last connector, but it started to cause an error in the absence of synchronization . This is another reason for me to hate MySQL.
source share