EntityFramework.Utilities icon indicating copy to clipboard operation
EntityFramework.Utilities copied to clipboard

IncludeEFU throws System.InvalidOperationException exception

Open alaatm opened this issue 9 years ago • 3 comments

When trying to use IncludeEFU to include a child collection, a InvalidOperationException is thrown when enumerating the query result. The exception message is: "The property 'p' on type 't' cannot be set because the collection is already set to an EntityCollection."

This happens on line: setter(parent, childs); in EFQueryHelper.cs

alaatm avatar Oct 31 '14 09:10 alaatm

Never mind, it works fine after disabling proxy generation.

alaatm avatar Oct 31 '14 09:10 alaatm

Thank you!

I will actually reopen this issue and update the documentation + add better exceptions for next release.

MikaelEliasson avatar Oct 31 '14 15:10 MikaelEliasson

This is also a problem with Lazy Loading. Fix both in the same way.

MikaelEliasson avatar Dec 03 '14 11:12 MikaelEliasson