示例#1
0
        public void From()
        {
            var s    = new Spec <Category>(x => x.Name == DbContextFixture.FirstCategoryName);
            var from = s.From <Product>(x => x.Category);

            var products = DbContext
                           .Products
                           .Include(x => x.Category)
                           .Where(from)
                           .ToList();

            Assert.All(products, x =>
                       Assert.Equal(x.Category.Name, DbContextFixture.FirstCategoryName));
        }