为什么 WCFTestclient 不理解标准 EF 对象但理解 STE 对象

发布于 2025-01-05 16:14:07 字数 541 浏览 0 评论 0原文

当我尝试使用公开返回标准 EF 对象的操作的 WCF 服务时,我收到有关这些操作的警告。该警告指出“WCF 测试客户端不支持此操作,因为它使用类型”。为我的 EF 模型中的实体生成的源代码包含普通的 C# 类,这些类继承自 EntityObject,并用 [EdmEntityType]、[Serialized] 和 [DataContract] 属性进行修饰。

如果我更改标准代码生成过程并生成自跟踪实体 (STE),我会收到也用 DataContract 属性装饰的类,但它们不再从 EntityObject 继承。 WCFTestClient 支持返回 STE 对象的 WCF 操作。

EntityObject 中是什么阻止了 WCFTestClient 调用/显示这些操作?

EntityObject 还用 [Serialized] 和 [DataContract] 进行修饰。

我知道除了 WCFTestClient 之外我还可以使用其他工具,并且我已经编写了自己的测试客户端,但我很好奇为什么它会这样。

When I try to consume a WCF service which expose operations that return standard EF objects I receive a warning on these operations. The warning states "This operation is not supported in the WCF Test Client because it uses type < EntityName >". The generated source code for the entities in my EF model contains ordinary C# classes, inherited from EntityObject and decorated with [EdmEntityType],[Serializable] and [DataContract] attribute.

If I change the standard code generation process and instead produce Self Tracking Entities (STE) I receive classes which are also decorated with the DataContract attribute but they don't inherit from EntityObject anymore. WCF Operations that return STE objects ARE supported by the WCFTestClient.

What is it in EntityObject that prevent WCFTestClient from calling / displaying these operations?

EntityObject is also decorated with [Serializable] and [DataContract].

I know there are other tools besides WCFTestClient that I could use and I have already coded my own testclient but I'm curious of why it behaves like this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文