public ActionResult Edit(int?id) { if (id == null) { return(RedirectToAction("Index", "Posts")); } var postModel = _postsService.GetPostModel(id.Value); return(View(postModel.Post)); }