1.dbContext.Configuration.LazyLoadingEnabled = false;

解决自动加载子类问题,去掉懒加载,手动Incolud代码。

2.config.EnableCors(new EnableCorsAttribute("*", "*", "*"));

解决跨域

3.//Ignore referenceloophandling for json.net

config.Formatters.JsonFormatter.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore;

忽略循环引用json

解决 "ExceptionMessage": "“ObjectContent`1”类型未能序列化内容类型“application/json; charset=utf-8”的响应正文。",

posted on 2018-03-08 16:33  cxd1008  阅读(299)  评论(0编辑  收藏  举报