예제 #1
0
        public void MatchesExpectedNumberOfItems(int blogId, int expectedCount)
        {
            var spec = new BlogByIdSpecification(blogId);

            var result = GetTestItemCollection()
                         .AsQueryable()
                         .Where(spec.Criteria);

            Assert.Equal(expectedCount, result.Count());
        }
예제 #2
0
        public async Task <IEnumerable <Blog> > GetAllBlogItems(int blogId)
        {
            var spec = new BlogByIdSpecification(blogId);

            return(await _blogRepository.ListAsync(spec));
        }