-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Lazy Loading adds lazyLoader to json output #12772
Comments
@ilushka85 The property is needed for the lazy-loading infrastructure used by proxies. However, we will add an attribute to the property in the future to prevent it being serialized. For now, this answer on Stack Overflow shows how it can be ignored from your code. Useful links for implementer: |
Fixes #12772 Using `IgnoreDataMember` for this since it doesn't bring in any new dependencies and is honored by JSON.NET.
Fixes #12772 Using `IgnoreDataMember` for this since it doesn't bring in any new dependencies and is honored by JSON.NET.
Fixes #12772 Using `IgnoreDataMember` for this since it doesn't bring in any new dependencies and is honored by JSON.NET.
Fixes #12772 Using `IgnoreDataMember` for this since it doesn't bring in any new dependencies and is honored by JSON.NET.
How to avoid this? |
return Ok(entity) in ASP.NET Core 6 Web API will still produce "lazyLoader": {} How to avoid this? @ajcvickers |
#28084 pls review |
This is still happening with EFCore 7.0 using System.Text.Json I do see the fix by #28084 is there in the latest package. However, it's not working, I am returning Entity that mapped to a SQL Server View, not Table. Does this fix includes View? |
@ilushka85 I am not able to reproduce this. Please open a new issue and attach a small, runnable project or post a small, runnable code listing that reproduces what you are seeing so that we can investigate. |
Almost a year has passed, the problem is still there with .NET 8.0, EF Core 8.0. It happens to SQL Server View, not Table! View not Table!! View, not Table!!! Could anyone apply the fix to View also, not Table! |
@EdiWang I am not able to reproduce this. Please open a new issue and attach a small, runnable project or post a small, runnable code listing that reproduces what you are seeing so that we can investigate. |
Hi @ajcvickers Thanks for the quick reply. I've created #33223 and attached a minimal runnable project. I'm able to reproduce the problem without a SQL Server View. It happens to Table also. |
When using lazy loading and data is returned by webapi the property lazyLoader is added.
How can this be removed and not automatically added?
The text was updated successfully, but these errors were encountered: