-
-
Notifications
You must be signed in to change notification settings - Fork 158
[2.4.0-beta1]: POST with self referencing inclusion returns null values (or default) in included entity #343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Is there any progress? Currently can't move from version 2.3.1, because one of the client standardly use POST with inclusion. So now I can´t use all those new sexy features after 2.3.1. |
This issue only occurs when you try to POST a resource with a relationship and try to return the relationship via I have a PR open now (#373) although I hit a bit of a snag with the HasMany relationship loading. The current version works but it enumerates the pointers and fetches them from the db individually 😬. I would like to find a better solution before releasing it. If you want I can push it to MyGet. You just need to be aware that the APIs will likely change before it actually gets released. Update: I've altered my approach and rather than reloading each relationships separately, I detach them from the context so EF is no longer tracking them. Then we can just re-query the newly created entity in the same way a |
fix(#343): reload relationships from database if included during POST
I have entity Client like this:
Trying to post like:
POST: http://localhost:5001/api/clients?include=recommender
It returns:
This is caused only when there is self referencing inclusion (client include another client).
When I change POST with entity of another type (commented Advisor for example), POST with inclusion returns all data normally.
In version 2.3.1 it works fine. 2.3.2 and above has this problem
The text was updated successfully, but these errors were encountered: