hope someone can help me, I've been searching, and haven't been able to find a solution. Might as well be something basic, I just can't find a solution.
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1)
.AddJsonOptions(opt =>
{
opt.SerializerSettings.ReferenceLoopHandLing =
Newtonsoft.Json.ReferenceLoopHandling.Ignore;
});
This code is trying to fix a problem with reference looping. I'm following a tutorial on building a webapp with .NET and Angular CLI. On the tutorial, it's shown, the loop error, that I also got on my code. Trying to follow the solution (code above) I got an error on the SerializerSettings, saying that JsonOptions do not contain a definition for such.
I tried:
adding [Obsolete] (suggested by visual studio),
installing the Microsoft.AspNetCore.MVC.Formatters.Json nuget package (which VS informed it was doing nothing when added), (saw this solution on Documentation and Here com StackOverflow)
Tried ReferenceLoopHandling as for Newtonsoft Json.Net documentation (I might not have used it properly so if anyone feels this is the way out, please show me)