You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Lazy Loading adds lazyLoader to json output #12772
@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.
@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.
@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.
Activity
ajcvickers commentedon Jul 30, 2018
@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:
Prevent ILazyLoader property in proxy from being serialized by JSON.NET
Prevent ILazyLoader property in proxy from being serialized by JSON.NET
Prevent ILazyLoader property in proxy from being serialized by JSON.NET
Prevent ILazyLoader property in proxy from being serialized by JSON.NET
EdiWang commentedon Jul 13, 2021
return Ok(entity)in ASP.NET 5 Web API will still produce"lazyLoader": {}How to avoid this?
EfimenkoAndrew commentedon May 23, 2022
return Ok(entity) in ASP.NET Core 6 Web API will still produce "lazyLoader": {}
How to avoid this? @ajcvickers
EfimenkoAndrew commentedon May 23, 2022
#28084 pls review
EdiWang commentedon Apr 26, 2023
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?
ajcvickers commentedon May 1, 2023
@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.
EdiWang commentedon Mar 1, 2024
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!
ajcvickers commentedon Mar 1, 2024
@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.
EdiWang commentedon Mar 3, 2024
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.