MongoClient in my c# console application to connect to MongoDBhttps://github.com/mongodb/mongo-csharp-driver/releases/tag/v
The reason is you need to wait to get the store to create the document. In this case collection.InsertOneAsync(entity); the execution exit before creating the document.
Either Console.ReadKey() or collection.InsertOneAsync(entiry).Wait() or any other form of stopping exit for a fraction of second will do the trick.