Skip to Content
0
Jan 20, 2021 at 11:56 PM

Error "An error occurred during serialization of the entity collection" with deep navigation

182 Views

Hi,

We get the error:

An error occurred during serialization of the entity collection.  
An error occurred during serialization of the entity with the following key(s): ID: 7aa24fe3-6a4b-4f6c-bb89-de29c3251990, IsActiveEntity: true.  
Not nullable value for 'ID' must not be null.

Screenrecoding (bad screenrecording but I think is enough)

https://github.com/sbarzaghialteaup/serialization_error/blob/master/explain_problem.gif

Repository with a project to reproduce:

https://github.com/sbarzaghialteaup/serialization_error

The odata request is:

GET Books?$count=true&$filter=(IsActiveEntity%20eq%20false%20or%20SiblingEntity/IsActiveEntity%20eq%20null)&$select=HasActiveEntity,ID,IsActiveEntity,title&$expand=author($select=ID,IsActiveEntity,name;$expand=city($select=ID,citizenCount,name))

Thanks for support

Sam