0
我有一个类实现ICollection<T>
接口:序列化数组作为MongoDB中C#驱动程序文件
class Test : ICollection<string>
{
[BsonElement("items")]
private List<string> _items;
[BsonElement("someOtherProp")]
public bool SomeOtherProperty { get; set; }
// ...ICollection<string> impl
}
默认情况下它是(去)系列化使用ArraySerializer
类,所以任何其他属性或场(偶数公共&饰有BsonElement
属性)被忽略。
有谁知道我该如何强制我的类被反序列化为一个普通的类?