예제 #1
0
        public IActionResult GetAll()
        {
            var users          = _userService.GetAll();
            var userViewModels = GenericMapper.MapListOfObjects <FullUserViewModel>(users);

            return(Ok(userViewModels));
        }
예제 #2
0
        public List <PageListItemViewModel> ListAllPages()
        {
            var result = new List <FullPageViewModel>();

            var pages = _pagesService.ListAllPages();

            return(pages.Count() == 0 ? null : GenericMapper.MapListOfObjects <PageListItemViewModel>(pages).ToList());
        }
예제 #3
0
        public List <PostListItemViewModel> LoadNextPosts(int loadedItems, int itemsCount)
        {
            var result = new List <PostListItemViewModel>();

            var posts = _postsService.LoadNextPosts(loadedItems, itemsCount);

            return(posts.Count() == 0 ? null : GenericMapper.MapListOfObjects <PostListItemViewModel>(posts).ToList());
        }
예제 #4
0
        public List <PostListItemViewModel> ListPostsByAuthor(string userName)
        {
            var result = new List <PostListItemViewModel>();

            var posts = _postsService.ListPostsByAuthor(userName);

            return(posts.Count() == 0 ? null : GenericMapper.MapListOfObjects <PostListItemViewModel>(posts).ToList());
        }
예제 #5
0
        public List <PostListItemViewModel> ListAllPosts()
        {
            var result = new List <PostListItemViewModel>();

            var posts = _postsService.ListAllPosts();

            return(posts.Count() == 0 ? null : GenericMapper.MapListOfObjects <PostListItemViewModel>(posts).ToList());
        }