带有集合的 Ria 服务实体在不应该是空的时候是空的? [英] Ria Services Entity with collection is empty when not supposed to?

查看:21
本文介绍了带有集合的 Ria 服务实体在不应该是空的时候是空的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有 Employee 和 EmployeeWorksiteReference 的对象模型(因为它是我和中间实体之间的多对多关系).

Hi I'm have an object model with an Employee and EmployeeWorksiteReference (cause it's an many to many relation I have and middle entity).

我在其上使用了 Association、Include 和 Composition 标签,以便在保存等时能够将其作为一个发送,并且在保存时效果很好.但是当我用一些 EmployeeWorksiteReferences 加载一个 Employee 时,集合在客户端上变成空的,当我在调试器返回结果之前检查它时,列表包含实例,但在客户端上,当它收到结果时,列表是空的.

I use Association, Include and Composition tags on it to be able to send it over as one when saving and so on, and when saveing it works perfectly. But when I load an Employee with some EmployeeWorksiteReferences the collection turns up empty on the client, when I check in the debugger exactly before it returns the result the list contains instances but on the client when it receives the result the list is just empty.

我做错了什么?

推荐答案

经过长时间调试类似问题后,我发现问题是由于我的模型中没有明确包含中间表实体.我最终通过添加缺少的中介类型并更新元数据来解决这个问题.

After many long hours of debugging a similar issue I found that the problem, in my case, was due to not explicitly including the intermediary table entity in my model. I finally fixed the issue by adding the missing intermediary type and updating the metadata to reflect it.

此处查看我对问题的完整解决方案.

See my full solution to the problem here.

这篇关于带有集合的 Ria 服务实体在不应该是空的时候是空的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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