public IActionResult Details(int id) { var post = _postData.Get(id); if (post == null) { return(RedirectToAction("Index")); } var dvm = new DetailsViewModel() { Post = post, Comments = _commentData.GetByPost(post.Id) }; return(View(dvm)); }