public DeleteCommentVm GetDeleteVm(int id) { Comment model = this.Context.Comments.Find(id); DeleteCommentVm vm = Mapper.Map <Comment, DeleteCommentVm>(model); return(vm); }
public ActionResult Delete([Bind(Include = "CommentId")] DeleteCommentBm bind) { if (this.ModelState.IsValid) { this.service.DeleteComment(bind); return(this.RedirectToAction("All")); } DeleteCommentVm vm = this.service.GetDeleteVm(bind.CommentId); return(this.View(vm)); }
public ActionResult Delete(int id) { DeleteCommentVm vm = this.service.GetDeleteVm(id); return(this.View(vm)); }