gpt4 book ai didi

c# - ServiceStack,Action 可以返回 `IEnumerable` 吗?

转载 作者:行者123 更新时间:2023-11-30 17:53:49 25 4
gpt4 key购买 nike

<分区>

编辑:请注意我的问题与编辑器显示的问题不同。我一般发送 IEnumerable 或 IDictionary 没有问题,但我在发送它们时遇到问题,包含接口(interface)。

请问ServiceStack是不是序列化或者传输接口(interface)的IEnumerable有问题?返回其他对象(例如 DTO 或字符串)的操作不会导致任何问题,但是当我尝试返回 IEnumerable<IWhateverInterface> 时然后一个空的枚举到达客户端。我在服务中的操作返回它们之前验证了可枚举包含所需的元素,因此我看到的唯一问题是序列化或发送部分。

我确保在所有相关类中引用该接口(interface)。

谁能阐明这一点?

谢谢

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com