Example #1
0
        private static void TestCsharpMongo()
        {
            var testDb = new MongoDabase("test");

            // add
            testDb.CollectionName <MongoTestCollection>().Insert(new MongoTestCollection
            {
                Name = Guid.NewGuid().ToString(),
                Age  = 1
            });

            // get all
            var result = testDb.CollectionName <MongoTestCollection>().FindAll();

            result.FirstOrDefault().Age = 100;

            // count
            testDb.CollectionName <MongoTestCollection>().Count();

            // delete
            testDb.CollectionName <MongoTestCollection>().Delete(x => x.Age == 1);
        }
Example #2
0
        private static void TestCsharpMongo()
        {

            var testDb = new MongoDabase("test");

            // add
            testDb.CollectionName<MongoTestCollection>().Insert(new MongoTestCollection
            {
                Name = Guid.NewGuid().ToString(),
                Age = 1
            });

            // get all
            var result = testDb.CollectionName<MongoTestCollection>().FindAll();
            result.FirstOrDefault().Age = 100;

            // count
            testDb.CollectionName<MongoTestCollection>().Count();

            // delete
            testDb.CollectionName<MongoTestCollection>().Delete(x => x.Age == 1);

        }
Example #3
0
 public void TestMethod1()
 {
     MongoDabase net = new MongoDabase("");
     var         x   = net.CollectionName <TestClass>("TestClass");
 }
Example #4
0
 public void TestMethod1()
 {
     MongoDabase net = new MongoDabase("");
     var x = net.CollectionName<TestClass>("TestClass");
     
 }