public async Task <IActionResult> Index(string keywork, int?pageSize, int page = 1) { var classified = new ClassifiedsDetailVM(); var data = await _classifiedsService.GetHotProduct(8); var listData = data.Select(a => ClassifiedsViewModel.form(a)).ToList(); classified.RelatedBlogs = listData; return(View(classified)); }
public async Task <IActionResult> Detail(int id) { var dataVM = new ClassifiedsDetailVM(); var data = await _classifiedsService.GetById(id); var RelatedBlogs = _classifiedsService.RelatedBlog(id, 8); dataVM.Data = ClassifiedsViewModel.form(data); dataVM.RelatedBlogs = RelatedBlogs; return(View(dataVM)); }