I am trying to create a helper class for interacting with MongoDb in C# 4.0. I've been reading some of the documentation on serializing to Bson, etc. but am a little lost. What I have is a generic MongoHelper class with and Add(T objectToAdd), Delete(T objectToDelete) and Update(T objectToUpdate) method. The constructor takes in the server, db and collection info.
I am having trouble however, trying to serialize from T. I ignorantly tried something like this:
BsonClassMap.RegisterClassMap().ToBsonDocument();
I'm really lost on such a simple thing. Please help!