In my web api when i run project for get data from database got this error .net core 3.1
JsonException: A possible object cycle was detected which is not
For net core 3.1 you have to add in Startup.cs:
services.AddMvc.AddJsonOptions(o => { o.JsonSerializerOptions.ReferenceHandler = ReferenceHandler.Preserve; o.JsonSerializerOptions.MaxDepth = 0; })
and import at least this package using nuget.org include prerelease: