如何在外部服务的元数据页面中隐藏 AutoQuery 端点?
How do I hide AutoQuery endpoints in metadata page on external service?
我有两个服务,服务 A 和服务 B。服务 A 调用服务 B,所以我在服务 A 中添加了对服务 B 的服务模型的引用。我 运行 遇到的问题是服务 B 的任何 AutoQuery 操作都显示在服务 A 的元数据中。服务 B 的其他操作不会显示,只有 AutoQuery 的。有没有办法在服务 A 的元数据页面中对服务 B 隐藏这些操作。
见下图,我已经突出显示了有问题的请求对象。
ServiceStack 通过类型引用确定将哪些服务模型包含在其服务元数据中。 2 个不同的服务模型不应该相互引用,理想情况下每个应用程序应该只有 1 个服务模型。
因此,您应该分离任何 ServiceModel 程序集引用,should be dependency-free, i.e. the only references your ServiceModel Assembly should have is to the dep/impl-free ServiceStack.Interfaces.dll which you can do by copying the types you need from the other Assembly into your ServiceModel as separate classes where you can use Auto Mapping 以复制不同程序集中不同类型之间的属性。
我有两个服务,服务 A 和服务 B。服务 A 调用服务 B,所以我在服务 A 中添加了对服务 B 的服务模型的引用。我 运行 遇到的问题是服务 B 的任何 AutoQuery 操作都显示在服务 A 的元数据中。服务 B 的其他操作不会显示,只有 AutoQuery 的。有没有办法在服务 A 的元数据页面中对服务 B 隐藏这些操作。
见下图,我已经突出显示了有问题的请求对象。
ServiceStack 通过类型引用确定将哪些服务模型包含在其服务元数据中。 2 个不同的服务模型不应该相互引用,理想情况下每个应用程序应该只有 1 个服务模型。
因此,您应该分离任何 ServiceModel 程序集引用,should be dependency-free, i.e. the only references your ServiceModel Assembly should have is to the dep/impl-free ServiceStack.Interfaces.dll which you can do by copying the types you need from the other Assembly into your ServiceModel as separate classes where you can use Auto Mapping 以复制不同程序集中不同类型之间的属性。