Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ruby-on-rails-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wcf data services WCF数据服务-上下文已在跟踪具有相同资源Uri的不同实体_Wcf Data Services - Fatal编程技术网

Wcf data services WCF数据服务-上下文已在跟踪具有相同资源Uri的不同实体

Wcf data services WCF数据服务-上下文已在跟踪具有相同资源Uri的不同实体,wcf-data-services,Wcf Data Services,关于我如何使用wcf数据服务,我的生产环境在DMZ模式中工作,因此我使用MVC项目,使用wcf数据服务连接到DMZ数据服务器,在本例中,wcf数据服务运行服务,MVC运行客户端 尝试使用proxy.UpdateObject(entity)然后proxy.SaveChanges()更新实体时,wcf data Services上出现错误。SaveChanges()抛出此错误“上下文当前未跟踪实体” 当我像proxy.AttachTo(“entity”,entity)那样将实体附加到上下文并第一次工

关于我如何使用wcf数据服务,我的生产环境在DMZ模式中工作,因此我使用MVC项目,使用wcf数据服务连接到DMZ数据服务器,在本例中,wcf数据服务运行服务,MVC运行客户端

尝试使用proxy.UpdateObject(entity)然后proxy.SaveChanges()更新实体时,wcf data Services上出现错误。SaveChanges()抛出此错误“上下文当前未跟踪实体”

当我像proxy.AttachTo(“entity”,entity)那样将实体附加到上下文并第一次工作时,这个问题就得到了解决

但是,再次更新实体会引发另一个错误“上下文已在跟踪具有相同资源Uri的不同实体”。对于此错误,我已尝试过,但没有使用luck Detach或TryGetEntity,但没有任何效果,然后我尝试使用proxy.GetEntityDescriptor(enity),但始终返回null