2
在asp.net mvc 5中对HttpClient使用PutAsJsonAsync扩展方法返回自检参考循环检测到的异常。使用HttpClient PutAsJsonAsync Extension检测到的自回参考循环
这里是调用代码:
httpClient.BaseAddress = _uri;
HttpResponseMessage response = await httpClient.PutAsJsonAsync<b>("index/1",b);
response.EnsureSuccessStatusCode();
对象B不会具有自参考。
所以我的问题是如何在一个asp.net mvc 5应用程序中设置SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore
。