Import Microsoft.AspNetCore.Mvc.NewtonsoftJson into Startup.cs and then make a stitch like so:
services.AddMvc(options =>
{
options.Filters.Add(new ValidateComponentIdentifier());
options.Filters.Add(new BubbleUpExceptions());
}).AddNewtonsoftJson(options => options.SerializerSettings.ReferenceLoopHandling =
Newtonsoft.Json.ReferenceLoopHandling.Ignore);
It is the last line above (well, the last two really) that is most important.
No comments:
Post a Comment