Example #1
0
 public static void Test_02(int i = 10, int j = 20)
 {
     Trace.WriteLine("Test_02");
     //test v = new test();
     ///v.t1 = "toto";
     //v.t2 = "tata";
     //_wr.View(v);
     List<test> list = new List<test>();
     list.Add(new test() { t1 = "toto1", t2 = "tata1" });
     list.Add(new test() { t1 = "toto2", t2 = "tata2" });
     list.Add(new test() { t1 = "toto3", t2 = "tata3" });
     list.Add(new test() { t1 = "toto4", t2 = "tata4" });
     list.Add(new test() { t1 = "toto5", t2 = "tata5" });
     list.Add(new test() { t1 = "toto6", t2 = "tata6" });
     list.zView();
 }
Example #2
0
 public static void Test_MongoDB_02()
 {
     Trace.WriteLine("Test_MongoDB_02");
     // 526a6df22d8daf1bd42f4f4a Tom
     // 526a72a62d8daf1bd42f4f4b Tata
     List<Entity> entities = new List<Entity>();
     MongoDatabase mdb = GetMongoDatabase();
     MongoCollection<Entity> collection = mdb.GetCollection<Entity>("entities");
     ObjectId id = new ObjectId("526a6df22d8daf1bd42f4f4a");
     Trace.WriteLine("get entity {0}", id);
     IMongoQuery query = Query<Entity>.EQ(e => e.Id, id);
     //Entity entity = collection.FindOne(query);
     entities.Add(collection.FindOne(query));
     entities.Add(collection.FindOne(Query<Entity>.EQ(e => e.Id, new ObjectId("526a72a62d8daf1bd42f4f4b"))));
     entities.zView();
 }