EF 序列化返回json时

报错:Self referencing loop detected for property

解决方案:在webapiconfig.cs文件中,增加设置:

  1.config.Formatters.JsonFormatter.SerializerSettings.ReferenceLoopHandling=Newtonsoft.Json.ReferenceLoopHandling.Serializer;

  2.Config.Fomatters.JsonFormatter.SerializerSettings.ReferenceLoopHandling=Newtonsoft.Json.preserveReferenceHandling.objects;

Self referencing loop detected for property 错误的更多相关文章

  1. codefirst mvc Self referencing loop detected for property

    登录时,json序列化用户类时提示错误"Self referencing loop detected for property--",经过5个小时的查找,发现原因可能是,用户类包含 ...

  2. Request failed with status code 500以及自引用循环Self referencing loop detected for property ‘xx‘ with type

    错误Error: Request failed with status code 500 ,调试前端没问题,后端也没问题,还报错"连接超时" 在Network中找到错误Self r ...

  3. JSON.NET的Self referencing loop detected with type的原因以及解决办法

    模型中有循环引用是很常见的.例如,以下模型显示双向导航属性: : public class Category : { : public Category() : { : Products = new ...

  4. EF关于报错Self referencing loop detected with type的原因以及解决办法

    1)具体报错 { "Message": "出现错误.", "ExceptionMessage": "“ObjectContent` ...

  5. .NET JSON 转换 Error ” Self referencing loop detected for type“

    在进行实体转换为Json格式报错如下图: Self referencing loop detected for property 'md_agent' with type 'System.Data.E ...

  6. c# json 序列化时遇到错误 error Self referencing loop detected for type

    参考网址:http://blog.csdn.net/adenfeng/article/details/41622255 在写redis缓存帮助类的时候遇到的这个问题,本来打算先序列化一个实体为json ...

  7. Json Self referencing loop detected

    Self referencing loop detected......的错误 解决方案: 1 增加  [JsonIgnore]  过滤关联,使其不参与序列化. 这个方法简单粗暴.但是你就没办法获取关 ...

  8. Self referencing loop detected with type

    json.net namespace EFDAL{    using System;    using System.Collections.Generic;    using Newtonsoft. ...

  9. Newtonsoft.Json转换强类型DataTable错误:Self referencing loop detected with type ......

    问题,在使用Newtonsoft.Json对强类型的DataTable进行系列化时会出现循环引用错误 解决办法,不要直接系列化强类型的DataTable,改为 JsonConvert.Serializ ...

随机推荐

  1. python爬虫的scrapy安装+pymongo的安装

    我的:python2.7版本    32位 注意scrapy只支持2.7及以上的版本. 1.安装python 2.安装pip 安装pip就不赘述了,网上很多教学 pip安装时要注意更新,如果pip版本 ...

  2. Python开发【第九篇】:协程、异步IO

    协程 协程,又称微线程,纤程.英文名Coroutine.一句话说明什么是协程,协程是一种用户态的轻量级线程. 协程拥有自己的寄存器上下文和栈.协程调度切换时,将寄存器上下文和栈保存到其他地方,在切换回 ...

  3. IDEA中,将项目加入maven管理。

    在项目上右键->Add Framework Support Choose Maven 生成pom.xml 在<project>下配置国内仓库 <properties>&l ...

  4. Git冲突标记介绍

    <<<<<<< head 是指你本地的分支的 <<<<<<< HEADb789=======b45678910> ...

  5. Chart Parser 中 Earley's 算法的应用

    1. 基本概念 1.1 状态 state 上下文无关文法规则 圆点 · (左边是已分析的,右边是未分析的:点在最右端表示完成状态,否则为未完成状态) 状态的起止位置 1.2 基本操作/算子 opera ...

  6. django admin的实用配置

    https://www.cnblogs.com/wumingxiaoyao/p/6928297.html

  7. [转]JSOUP 抓取HTTPS/HTTP网页,校验问题

    针对一般的http请求是不需要的校验的.但是https安全校验过总过不去.最后找到以下方法,终于成功. 让我们的站点信任所有站点,不需要引包,系统自带ssl证书校验,话不多数,贴代码. /** * 信 ...

  8. Itreatot接口实现类中modCount的作用

    modCount只有在本数据结构对应迭代器中才使用,以HashMap为例: private abstract class HashIterator implements Iterator { Entr ...

  9. 解决Ubuntu 16.04 上Android Studio2.3上面运行APP时提示DELETE_FAILED_INTERNAL_ERROR Error while Installing APKs的问题

    本人工作环境:Ubuntu 16.04 LTS + Android Studio 2.3 AVD启动之后,运行APP,报错提示: DELETE_FAILED_INTERNAL_ERROR Error ...

  10. [C#.net]SqlDataAdapter 执行超时已过期 完成操作之前已超时或服务器未响应

    随着数据库数据的不断增大,查询时间也随之增长.而客户端与数据库连接时间以及命令的执行时间都是有限的.默认为30s.所以在查询数据的时候,程序会出现 “超时时间已到.在操作完成之前超时时间已过或服务器未 ...