无法访问 silverlight 客户端上的 EntityCollection
我使用 silverlight 业务应用程序模板创建了一个 silverlight 应用程序。
我添加了一个 ADO.NET 实体数据模型,并在设计器中从头开始创建它。然后我从模型生成了一个数据库。该模型有一个“项目”实体和一个具有多对多关系的“客户”实体。
然后,我向 .web 项目添加了一个域服务,并从我的模型中选择了实体。在服务的生成方法中,服务器端,我可以访问“Client.Projects”属性,也可以访问“Project.Clients”属性,但我无权在客户端(在我的 silverlight 中)访问此属性应用。
如果我将客户端和项目之间的关系更改为一对多关系,我就可以访问 silverlight 客户端上的属性。
我应该怎么做才能访问 silverlight 客户端上的属性?
任何帮助将不胜感激
-Morten
I have created a silverlight application, using the silverlight business application template.
I added a ADO.NET entity data model, and created it from scratch in the designer. I then generated a database from the model. The model has a "project" entity and a "client" entity with a many-to-many relationship.
Then, I added a domainservice to my .web project, and selected the entities from my model. In the generated methods for the service, server-side, I have access to the "Client.Projects" property, and also the "Project.Clients" property, but I do not have access to this on the client side, in my silverlight application.
If I change to a one-to-many relationship between the Client and the project, I get access to the property on the silverlight client.
What should I do to get access to the properties on the silverlight client?
Any help would be most appreciated
-Morten
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在多对多关系中,您有可能拥有“循环”引用的对象。换句话说,一个实体具有另一个实体的属性,而另一个实体又具有指向原始实体的属性引用。
循环引用无法通过 Web 服务或 WCF 服务进行序列化,因此您可能必须打破模型中的多对多关系,以便可以进行序列化。
In a many-to-many relationship, there is a chance that you will have "circular" referenced objects. In other words, one entity has a property of another entity, which in turn has a property reference back to the original entity.
Circular referenced cannot be serialized over a web service or WCF service, so you are probably going to have to break the many-to-many relationship in your model so serialization is possible.