Example #1
0
        public void DeleteWithQueryOverExtension()
        {
            using (var scope = new SessionScope()) {
                var blog = new Blog {
                    Name = "hammett's blog", Author = "hamilton verissimo"
                };
                blog.Save();

                scope.DeleteAll <Blog>(b => b.Author == "hamilton verissimo");

                var blogs = Blog.FindAll();
                Assert.IsNotNull(blogs);
                Assert.AreEqual(10, blogs.Count());
            }
        }
        public void DeleteWithQueryOverExtension()
        {
            using (var scope = new SessionScope()) {

                var blog = new Blog {Name = "hammett's blog", Author = "hamilton verissimo"};
                blog.Save();

                scope.DeleteAll<Blog>(b => b.Author == "hamilton verissimo");

                var blogs = Blog.FindAll();
                Assert.IsNotNull(blogs);
                Assert.AreEqual(10, blogs.Count());
            }
        }