public async Task <IActionResult> Details(string cate_slug = "", string slug = "") { //ViewBag.RelatedNews = await newDAL.GetlistRelatedNews(cate_slug, slug); homeViewModels.DetailNews = await newDAL.GetNewsdetail(cate_slug, slug); if (homeViewModels.DetailNews == null || homeViewModels.DetailNews.Id == 0) { string url = Ultilities.Common.GetByKey("domain_fontend") + cate_slug + "/" + slug + ".html"; if (Ultilities.Common.GetByKey("AllowSendmail") == "1") { MailHelper.SendMail(Ultilities.Common.GetByKey("Mailreceived"), "Sao Hà Thành", "Đường dẫn " + url + " không hợp lệ! Vui lòng kiểm tra lại"); } return(RedirectToAction("NotFound", "Common")); } // home.DetailNews = home.DetailNews ?? new News(); // home.ListComment = CommentsService.Instance.GetComments(); homeViewModels.listtagbyId = await tagDAL.GetTagListbyId(slug); //model = model ?? new News(); return(View(homeViewModels)); }