public IActionResult GetAll() { var users = _userService.GetAll(); var userViewModels = GenericMapper.MapListOfObjects <FullUserViewModel>(users); return(Ok(userViewModels)); }
public List <PageListItemViewModel> ListAllPages() { var result = new List <FullPageViewModel>(); var pages = _pagesService.ListAllPages(); return(pages.Count() == 0 ? null : GenericMapper.MapListOfObjects <PageListItemViewModel>(pages).ToList()); }
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()); }
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()); }
public List <PostListItemViewModel> ListAllPosts() { var result = new List <PostListItemViewModel>(); var posts = _postsService.ListAllPosts(); return(posts.Count() == 0 ? null : GenericMapper.MapListOfObjects <PostListItemViewModel>(posts).ToList()); }