public async Task <LandingDto> GetLanding([FromQuery] int?order) { var posts = await _postService.GetAllPosts(order); var cates = await _cateService.GetAllCates(); var postAndCate = new LandingDto(); postAndCate.TrendingPosts = _mapper.Map <IEnumerable <PostListDto> >(posts); postAndCate.Categories = _mapper.Map <IEnumerable <CategoryDto> >(cates); return(postAndCate); }
public async Task <LandingDto> GetTrendingList() { var posts = await _postService.GetAllPost(); var cates = await _cateService.GetAllCates(); var postAndCate = new LandingDto(); postAndCate.listPost = _mapper.Map <IEnumerable <PostDto> >(posts); postAndCate.listCate = _mapper.Map <IEnumerable <CategoryDto> >(cates); return(postAndCate); }