自我跟踪实体和更新关系数据的问题 [英] Problem with Self Tracking Entities and Updating relational data

查看:62
本文介绍了自我跟踪实体和更新关系数据的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我在使用自我跟踪实体保存图表时遇到问题。

我的实体是:



考试

大学

大学考试
   大学ID

    ExamID

学生

    UniversityExamID

   

我的对象图如下:

大学有考试表考试。学生可以参加一些考试。我有一个StudentDetailsForm,其中包含学生共同详细信息选项卡和学生考试选项卡。

我可以添加一个考试,但是对于第二个考试,我得到"AcceptChanges无法继续,因为对象的键值与另一个对象冲突在ObjectStateManager中。在调用AcceptChanges之前,请确保键值是唯一的。"例外。

问题在于大学考试使用的一些普通实体,如大学。有没有解决方法,你们如何设法加入这种添加相关的实体。有人可以共享一些源代码。我认为对很多人来说,这对b $ b b很有用。



P.S.我正在使用WCF,自我跟踪实体和智能客户端开发3层应用程序。

Hi All,

I have problem with saving a graph with Self Tracking Entities.
My entities are:

Exams
University
UniversityExams
    UniversityID
    ExamID
Student
    UniversityExamID
   
My object graph is as follows:
University has exams from Exams table. A student can take some exams. I have a StudentDetailsForm with student common details tab and student exams tab.
I can add one exam, but for the second one I get the "AcceptChanges cannot continue because the object's key values conflict with another object in the ObjectStateManager. Make sure that the key values are unique before calling AcceptChanges." exception.
The problem is about some general entities that both the UniversityExams use like University. Is there a work around and how do you guys manage to hadle this kind of Adding related entities. Can someone share some source code. I think it would be helpful for a lot of people.

P.S. I'm developing a 3 tier application using WCF, Self-Tracking Entities and Smart Client.

推荐答案

我是唯一一个遇到此问题的人。

Am I the only one who has this problem.

在保存实体图表时,是否可以与自我跟踪实体开发业务应用程序的人分享一些代码?

Can, please, someone who has developed a business application with Self Tracking Entities share some code when saving a an entity graph?

 

提前致谢


这篇关于自我跟踪实体和更新关系数据的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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