예제 #1
0
 public static async Task Test2()
 {
     var connectionString = System.Configuration.ConfigurationManager.ConnectionStrings["mongodb"].ConnectionString;
     var db = new MongoDb(connectionString);
     var t1 = new Table1()
     {
         ID = 8, Name = "8527y"
     };
     await db.Update(t1);
 }
예제 #2
0
        public static async Task Test()
        {
            var connectionString = System.Configuration.ConfigurationManager.ConnectionStrings["mongodb"].ConnectionString;
            var db = new MongoDb(connectionString);
            var t1 = new Table1()
            {
                ID = 9, Name = "999"
            };
            await db.Insert <Table1>(t1);

            var db2 = new MongoDb("localhost", 27018);
            var t2  = new Table1()
            {
                ID = 8, Name = "888"
            };
            await db2.Insert <Table1>(t2);
        }