字典没有正确序列化。
我有WCF服务,我尝试从客户端向服务器发送“ 0”。我的WCF服务使用默认的BasicHttpBinding。
当我将字典发送到服务器时,不会引发任何错误。但是当我尝试循环通过我的字典时,它是空的。
奇怪的是
Dictionary<string, string>
实际上有效吗?
有人知道我的ѭ0passes通过导线后为何为空以及为什么Dictionary<string, string>
起作用的想法。
[编辑]
这是我的结构的样子:
[DataContract]
public struct CustomStruct : IEquatable<CustomStruct>
{
[DataMember]
private string _prop;
public string Prop { get { return _prop; } }
public override int GetHashCode()
{
return Prop.GetHashCode();
}
public static bool operator ==(CustomStruct left, CustomStruct right)
{
...
}
public static bool operator !=(CustomStruct left, CustomStruct right)
{
...
}
public override bool Equals(object obj)
{
...
}
}
没有找到相关结果
已邀请:
2 个回复
距相镭
孝箱捆讨