Self referencing loop detected with type
json.net
namespace EFDAL
{
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
public partial class MaterielProcedures
{
public int Kid { get; set; }
public Nullable<int> OKid { get; set; }
public int Node { get; set; }
public string ProcedureType { get; set; }
public string ProcedureNeed { get; set; }
public string Author { get; set; }
public System.DateTime CreateTime { get; set; }
public Nullable<System.DateTime> StartTime { get; set; }
public Nullable<double> PlanHour { get; set; }
public Nullable<System.DateTime> EndTime { get; set; }
public Nullable<int> PercentAge { get; set; }
public string ProcedureState { get; set; }
public bool IsOut { get; set; }
public virtual bom_2d bom_2d { get; set; }
}
}
var MPtest = conn.MaterielProcedures.Where(X => X.OKid == Kid).ToList();
string str2 = JsonConvert.SerializeObject(MPtest); // 报错位置
Response.Write(str2);
Self referencing loop detected with type
'System.Data.Entity.DynamicProxies.MaterielProcedures_203DBD2B01DBAD67AF86F4C0C0B7C95197B2BF101DB5CE3063BF24A1DEB2DD69'.
Path 'bom_2d.MaterielProcedures'.
外键 哦 ,
官方解说
http://msdn.microsoft.com/zh-tw/library/cd43263e-441d-4b51-a9d0-440090c2f707
个人解决方案
[JsonIgnore]
public virtual bom_2d bom_2d { get; set; }
Self referencing loop detected with type的更多相关文章
- c# json 序列化时遇到错误 error Self referencing loop detected for type
参考网址:http://blog.csdn.net/adenfeng/article/details/41622255 在写redis缓存帮助类的时候遇到的这个问题,本来打算先序列化一个实体为json ...
- JSON.NET的Self referencing loop detected with type的原因以及解决办法
模型中有循环引用是很常见的.例如,以下模型显示双向导航属性: : public class Category : { : public Category() : { : Products = new ...
- .NET JSON 转换 Error ” Self referencing loop detected for type“
在进行实体转换为Json格式报错如下图: Self referencing loop detected for property 'md_agent' with type 'System.Data.E ...
- EF关于报错Self referencing loop detected with type的原因以及解决办法
1)具体报错 { "Message": "出现错误.", "ExceptionMessage": "“ObjectContent` ...
- Newtonsoft.Json转换强类型DataTable错误:Self referencing loop detected with type ......
问题,在使用Newtonsoft.Json对强类型的DataTable进行系列化时会出现循环引用错误 解决办法,不要直接系列化强类型的DataTable,改为 JsonConvert.Serializ ...
- 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 ...
- codefirst mvc Self referencing loop detected for property
登录时,json序列化用户类时提示错误"Self referencing loop detected for property--",经过5个小时的查找,发现原因可能是,用户类包含 ...
- Self referencing loop detected for property 错误
EF 序列化返回json时 报错:Self referencing loop detected for property 解决方案:在webapiconfig.cs文件中,增加设置: 1.config ...
- Json Self referencing loop detected
Self referencing loop detected......的错误 解决方案: 1 增加 [JsonIgnore] 过滤关联,使其不参与序列化. 这个方法简单粗暴.但是你就没办法获取关 ...
随机推荐
- [原创].NET 业务框架开发实战之九 Mapping属性原理和验证规则的实现策略
原文:[原创].NET 业务框架开发实战之九 Mapping属性原理和验证规则的实现策略 .NET 业务框架开发实战之九 Mapping属性原理和验证规则的实现策略 前言:之前的讨论一直关注在怎么从D ...
- 第七章——DMVs和DMFs(1)
原文:第七章--DMVs和DMFs(1) 简介: 从SQLServer2005开始,微软引入了一个名叫DMO(动态管理对象)的新特性,DMO可以分为DMFs(Dynamic Manage Functi ...
- Sphinx/Coreseek 4.1 跑 buildconf.sh 一个错误,无法生成configure档
安装前 coorseek 什么时候,遇到一些错误.该官方网站无法看到的解决方案,终于 google 在大牛的博客评论区找到一个解决方案.突然跑到他的膝盖介绍~~ 这里整理是为了方便一些人发现,墙毕竟让 ...
- NSIS:禁止选择安装路径和编辑安装目录
原文 NSIS:禁止选择安装路径和编辑安装目录 如果你想在安装包中禁止用户选择安装路径和编辑安装目录,有两种方式. 第一种:注释或删除安装目录选择页面 1 ;!insertmacro MUI_PA ...
- Linux在device is busy处理
在Linux管理umount设备时,时常会遇到"device is busy", 假设umount一个文件系统碰到这样的情况.而且你并没有在所需卸载的文件夹下.那么非常可能实用户或 ...
- Linux Kernel系列 - 黄牛X内核代码凝视
Hanks.Wang - 专注于操作系统与移动安全研究.Linux-Kernel/SELinux/SEAndroid/TrustZone/Encription/MDM Mail - byhank ...
- Java并发专题 带返回结果的批量任务执行 CompletionService ExecutorService.invokeAll(转)
转载请标明出处:http://blog.csdn.net/lmj623565791/article/details/27250059 一般情况下,我们使用Runnable作为基本的任务表示形式,但是R ...
- Android fragment onActivityResult 不起作用
fragment 跳转至Acivity后,fragment里面的onActivityResult 被被调用 试过非常多办法,最后getactivity().startactivityforresult ...
- hdu 4864 Task---2014 Multi-University Training Contest 1
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4864 Task Time Limit: 4000/2000 MS (Java/Others) M ...
- sk_buff整理笔记(两、操作函数)
承接上一:sk_buff 整理笔记(一.数据结构)这一篇要讲的是内核为sk_buff结构提供的一些操作函数. 第一.首先要讲的是sk_buff中的四大指针: 四大指针各自是:head.data.tai ...