我怎样才能看到实体框架的悬而未决的变化? [英] How can I see the Entity Framework's pending changes?

查看:139
本文介绍了我怎样才能看到实体框架的悬而未决的变化?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建的ADO.NET实体框架的应用程序。

I'm creating an application with the ADO.NET Entity Framework.

我可以通过我的code线由行一步,同时调试和观看SQL Server设置为每个查询执行的,但我无法揣摩出所有的SQL命令的来源!

I can step through my code line-by-line while debugging and watch SQL Server Profiler for every query executed, but I can't figure out where all those SQL commands are coming from!

有时候,当我执行的SaveChanges(),实体框架执行意外的,怪异的插入。他们有时会破坏应用程序。我也弄不清我在做什么,以使他们。

Sometimes when I execute SaveChanges(), the Entity Framework performs unexpected, weird INSERTS. They sometimes break the application. I can't figure out what I'm doing to cause them.

我如何监控排队等待挂起更改的的SaveChanges()打电话?

How can I monitor the pending changes that queue up waiting for a SaveChanges() call?

推荐答案

看看

myObjectContext.ObjectStateManager.GetObjectStateEntries(EntityState.Added)

这里

这篇关于我怎样才能看到实体框架的悬而未决的变化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆