Ejemplo n.º 1
0
        public void ShouldSupportLinq()
        {
            var store = new DocumentStore(storePath);

            store.Insert( new Person { Name = "Georges", Age = 35 } );
            store.Insert( new Person { Name = "Vivi", Age = 32 } );

            var names = from p in store.All<Person>() where p.Age > 33 select p.Name;

            Assert.AreEqual(2, store.All<Person>().Count());
            Assert.AreEqual(1, names.Count());
            Assert.AreEqual("Georges", names.First());

            store.Close();
        }
Ejemplo n.º 2
0
        public void ShouldSupportLinq()
        {
            var store = new DocumentStore(storePath);

            store.Insert(new Person {
                Name = "Georges", Age = 35
            });
            store.Insert(new Person {
                Name = "Vivi", Age = 32
            });

            var names = from p in store.All <Person>() where p.Age > 33 select p.Name;

            Assert.AreEqual(2, store.All <Person>().Count());
            Assert.AreEqual(1, names.Count());
            Assert.AreEqual("Georges", names.First());

            store.Close();
        }
Ejemplo n.º 3
0
        public void ShouldSaveObject()
        {
            var store = new DocumentStore(storePath);

            store.Insert( new Person { Name = "Georges", Age = 35 } );

            var person = store.All<Person>().First();

            Assert.AreEqual(1, store.All<Person>().Count());
            Assert.AreEqual("Georges", person.Name);
            Assert.AreEqual(35, person.Age);

            store.Close();
        }
Ejemplo n.º 4
0
        public void ShouldSaveObject()
        {
            var store = new DocumentStore(storePath);

            store.Insert(new Person {
                Name = "Georges", Age = 35
            });

            var person = store.All <Person>().First();

            Assert.AreEqual(1, store.All <Person>().Count());
            Assert.AreEqual("Georges", person.Name);
            Assert.AreEqual(35, person.Age);

            store.Close();
        }