![](/img/trans.png)
[英]How can I use latest MongoDB C# Driver to delete an element within a nested array of complex array objects based on multiple conditions?
[英]How can I use wcf serializer for serialize objects within mongodb c# driver?
我有一個實現IBsonSerializer的類:
public class PersistentObject : IBsonSerializer
{
public object Id { get; set; }
public object Deserialize(BsonReader bsonReader, Type nominalType, IBsonSerializationOptions options)
{
throw new NotImplementedException();
}
public object Deserialize(BsonReader bsonReader, Type nominalType, Type actualType, IBsonSerializationOptions options)
{
throw new NotImplementedException();
}
public bool GetDocumentId(object document, out object id, out Type idNominalType, out IIdGenerator idGenerator)
{
throw new NotImplementedException();
}
public void Serialize(BsonWriter bsonWriter, Type nominalType, object value, IBsonSerializationOptions options)
{
throw new NotImplementedException();
}
public void SetDocumentId(object document, object id)
{
throw new NotImplementedException();
}
}
是否可以使用WCF序列化器實現序列化和反序列化方法?
您不必實現IBsonSerializer。 MongoDB映射器可以序列化您的對象。 有關更多信息和示例, 請訪問http://www.mongodb.org/display/DOCS/CSharp+Driver+Serialization+Tutorial 。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.