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] 过滤关联,使其不参与序列化. 这个方法简单粗暴.但是你就没办法获取关 ...
随机推荐
- 栈上分配存储器的方法 alloca 抽样
声明一个局部变量,必须分配在堆栈上,但有或没有它的方法 当然,,那是 alloca 下面的代码显示了可变长度参数转换,alloca 要使用 int main(int argc, char ** arg ...
- centos下一个bash: XXX: command not found解决方案
最近想centos通过做Android工程建设.配置jdk和Android sdk后,也同时/etc/profile将java和Android环境变量配置成,但它不能像windows 在相同,直接使用 ...
- js怎样推断一个对象{}是否为空对象,没有不论什么属性
js怎样推断一个对象{}是否为空对象,没有不论什么属性 前段时间用js写了一个相似"angularjs"用于数据绑定的东西,功能是比較简单了, 通常应该传进来的是一个ArrayLi ...
- Java版网络爬虫基础(转)
网络爬虫不仅仅可以爬取网站的网页,图片,甚至可以实现抢票功能,网上抢购,机票查询等.这几天看了点基础,记录下来. 网页的关系可以看做是一张很大的图,图的遍历可以分为深度优先和广度优先.网络爬虫采取的广 ...
- Linux网络基础设施配置
1.TCP/IP网络配置文件 /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network /etc/host.conf /etc/ ...
- Sphinx/Coreseek 4.1 跑 buildconf.sh 一个错误,无法生成configure档
安装前 coorseek 什么时候,遇到一些错误.该官方网站无法看到的解决方案,终于 google 在大牛的博客评论区找到一个解决方案.突然跑到他的膝盖介绍~~ 这里整理是为了方便一些人发现,墙毕竟让 ...
- Nginx并发訪问优化
Nginx反向代理并发能力的强弱,直接影响到系统的稳定性.安装Nginx过程,默认配置并不涉及到过多的并发參数,作为产品执行,不得不考虑这些因素.Nginx作为产品执行,官方建议部署到Linux64位 ...
- ubuntu安装jdk eclipse mysql等
linux ubuntu下安装java web开发环境,需要安装包: jdk7 eclipse(选择java EE developer) apche-tomcat mysql(workbench可视化 ...
- 于PsIsSystemThread无论是在线程系统线程标识获得
我一直好奇一个进程的所有线程改变线程标志Terminated mov edi, edi ; IoIsSystemThread push ebp mov ebp, esp mov eax, [ebp+a ...
- mysql位_01检查错误代码的方法
1 看到官方帮助文档 当前最新版本号的错误码见 http://dev.mysql.com/doc/refman/5.7/en/error-handling.html 2 在安装mysql的环境中调用m ...