更新时间:2023-02-15 21:57:56
好吧...我终于找到了一些参考资料.解决方案是:
Okay... I finally found some reference material on this. The solution is:
public void ConfigureServices(IServiceCollection services)
{
...
services.AddMvc()
.AddJsonOptions(
options => options.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore
);
...
}
我从此处