[英]class ObservableDictionary<TKey, TValue> : IDictionary<TKey, TValue> as DataContract
How to decorate 如何装修
public class ObservableDictionary<TKey, TValue> : IDictionary<TKey, TValue>, INotifyCollectionChanged, INotifyPropertyChanged
as DataContract
(or something like this) in WCF
service? 作为
WCF
服务中的DataContract
(或类似的东西)?
据我所记得,如果您的ObservableDictionary<TKey, TValue>
类是可序列化的,则自WCF 3.5 SP1起,无需将其标记为DataContract
(请参阅问题: WCF datacontract vs class serialize )。
You need CollectionDataContractAttribute
您需要
CollectionDataContractAttribute
The CollectionDataContractAttribute is also intended to be used with dictionary types to handle keyed collections.
CollectionDataContractAttribute也旨在与字典类型一起使用以处理键集合。 Dictionary types are classes that implement either the IDictionary or the IDictionary interface, for example, the Dictionary.
字典类型是实现IDictionary或IDictionary接口的类,例如Dictionary。
Take a look for more details CollectionDataContractAttribute Class 查看更多详细信息CollectionDataContractAttribute类
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.