简体   繁体   English

使用Telerik OpenAccess ORM的WCF服务和LightSwitch-编辑不起作用,声称“指定的实体不受上下文管理”

[英]WCF Service and LightSwitch using Telerik OpenAccess ORM - editing doesn't work, claims “Specified entity is not managed by a context”

I stumbled upon an issue after following the steps described in http://documentation.telerik.com/openaccess-orm/quick-start-scenarios/getting-started-root-quickstart-vs-light-switch-wcf-ria . 按照http://documentation.telerik.com/openaccess-orm/quick-start-scenarios/getting-started-root-quickstart-vs-light-switch-wcf-ria中所述的步骤,我偶然发现了一个问题。 I can generate the Model and the Service just fine and adding the DataSource to the Lightswitch project also proceeds without a problem. 我可以很好地生成Model和Service,并且将DataSource添加到Lightswitch项目中也可以顺利进行。

If I afterwards create a Desktop client with a screen based on the OpenAccess Service, I can filter and view the data properly, but any attempt at editing or deleting existing records results in an error message stating "Specified entity is not managed by a context". 如果以后使用基于OpenAccess Service的屏幕创建桌面客户端,则可以正确过滤和查看数据,但是任何尝试编辑或删除现有记录的操作都会导致错误消息,指出“指定的实体不受上下文管理” 。 Adding new records works alright (and the newly added records exhibit the same symptoms). 可以正常添加新记录(并且新添加的记录表现出相同的症状)。

I'm working in Visual Studio 2013 and followed the steps from the Quick Start guide. 我在Visual Studio 2013中工作,并且遵循《快速入门》指南中的步骤。 Is there something I'm missing here? 我在这里想念什么吗? Did anybody succeed at getting a LightSwitch-editable Service from OpenAccess or is it some sort of a known issue that's not stated anywhere explicitly? 有没有人成功地从OpenAccess获得可编辑LightSwitch的服务,还是某种已知问题未在任何地方明确提出?

I posted the same question on the Telerik Forum and they admitted that they could reproduce this error but could not find any workaround at the moment. 我在Telerik论坛上发布了相同的问题,他们承认他们可以重现此错误,但目前找不到任何解决方法。 They added the issue to their Lighswitch integration roadmap but the timeframe for the fix is yet unknown. 他们将问题添加到了Lighswitch集成路线图中,但修复的时间框架尚不清楚。

I solved the problem replacing Telerik OpencAccess ORM with classic WCF RIA Service solution (according to the tutorial: http://www.c-sharpcorner.com/UploadFile/raj1979/how-to-use-wcf-ria-service-in-lightswitch-2012/ ). 我解决了用经典WCF RIA服务解决方案替换Telerik OpencAccess ORM的问题(根据该教程: http ://www.c-sharpcorner.com/UploadFile/raj1979/how-to-use-wcf-ria-service-in- lightswitch-2012 / )。 I also had to switch to Visual Studio 2012 to be able to create a Domain Service Class. 我还必须切换到Visual Studio 2012才能创建域服务类。

Summing up, I had to change some tools but everything works perfectly now. 总结一下,我不得不更换一些工具,但是现在一切都可以正常工作了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM