I discovered an error for Microsoft Connect, but no response ( see below) for their answer) for a long time. So here it is:
When trying to query the entity structure with its relation using the "Include" function in the linq query, it is not possible to query the relation through a path of more than 8 steps (8-point characters in the path). This prevents me from fulfilling some of my dynamically generated queries that require access to more than the redirect level.
Instead of successfully completing the request, I get the following exception:
"Foo.Bar.Baz...(some more path string here)", the current limit of "8" is insufficient.
at System.Data.Common.MultipartIdentifier.IncrementStringCount(String name, String[] ary, Int32& position, String property)
at System.Data.Common.MultipartIdentifier.ParseMultipartIdentifier(String name, String leftQuote, String rightQuote, Char separator, Int32 limit, Boolean removequotes, String property, Boolean ThrowOnEmptyMultipartName)
at System.Data.Objects.Span.ParsePath(String path)
at System.Data.Objects.Span.Include(String path)
at System.Data.Objects.Span.IncludeIn(Span spanToIncludeIn, String pathToInclude)
Has anyone understood why this is, or a way around this? Looking at the ParsePath code (with a reflector), it seems like they hardcoded the magic number 8 there ...
UPDATE : Microsoft answer:
Thanks for raising this issue. We plan to remove the limit on the number of elements in the Include path in the next version.
UPDATE 2 . Despite Microsoft's answer above, the error was not fixed in EF 4.1
UPDATE 3 . According to Microsoft, it should be fixed in .NET 4.5, but I have not tested the developer preview to see if it works.