2

我在我的一个项目中使用 Servicestack,并且好奇是否可以在 DTO 对象的 IReturn 接口中指定数组类型。

例如:

public sealed class Search : IReturn<Offer[]> { }

但是,如果我将此类用作 DTO,它总是会失败并出现序列化错误 System.ArgumentException: Value was invalid。

调用堆栈中的一些附加信息: System.Runtime.Serialization.FormatterServices.nativeGetUninitializedObject(RuntimeType type) System.Runtime.Serialization.FormatterServices.GetUninitializedObject(Type type)

我可以使用列表类,但更喜欢使用非可变类型,如数组类型。

4

0 回答 0