Esempio n. 1
0
        public BlogController(IBlogService blogService)
        {
            _blogService = blogService;

            if (_blogService.AllBlogs().Count() == 0)
            {
                _blogService.AddBlog(new BlogItem {
                    Title = "First Post"
                });
            }
        }
Esempio n. 2
0
        public IEnumerable <BlogItem> GetBlogItems()
        {
            var blogs = _blogService.AllBlogs();

            return(blogs.ToList());
        }