Is it possible to deep clone an object using MongoDB? in C# like:
Object1 _object2 = new Object1();
BsonValue _bsonValue = _object2.ToBsonDocument().DeepClone()
//now _bsonValue to "Object1" - how to?
How do I convert a “_bsonValue” back to “Object1” class? This is not really for saving object to MongoDB, just deep cloning an object and using the object elsewhere
Convert _bsonValue back to an BsonDocument with ToBsonDocument() and then it’s up to you to convert from that back to your class.