C# Json loop

mimi·2021년 1월 13일
0

env/ .net5

  • is possible .net core

A possible object cycle was detected. This can either be due to a cycle or if the object depth is larger than the maximum allowed depth of 32. Consider using ReferenceHandler.Preserve on JsonSerializerOptions to support cycles.

Install-Package Microsoft.AspNetCore.Mvc.NewtonsoftJson
services.AddControllersWithViews()
	.AddNewtonsoftJson(options =>
    	options.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore
    );

0개의 댓글