示例#1
0
        public PostDTO GetPost(string year, string month, string day, string title)
        {
            using (var context = new BlogSpotContext())
            {
                var repository = new PostsRepository(context);
            }

            return(null);
        }
示例#2
0
        public ICollection <PostDTO> get()
        {
            using (var context = new BlogSpotContext())
            {
                var repository = new PostsRepository(context);
                var posts      = repository.GetPostsRange(1 - 1, 10);

                var postsDto = Mapper.Map <ICollection <Post>, ICollection <PostDTO> >(posts);
                return(postsDto);
            }
        }