using MongoDB.Driver; namespace Ds.WMS.MogonDb { public class MogonDbHelper { public void inerst() { var client = new MongoClient("mongodb://{MongoDB}:27017"); IMongoDatabase database = client.GetDatabase("Test"); database.CreateCollection("Test"); var collection1 = database.GetCollection("Test"); collection1.InsertOne(new Test1 { Name = "Test1" }); } } public class Test1 { public string Name { get; set; } } }