public ActionResult PostDetails(Comment comment, ICreateService service, IDetailService serviceDetail) { if (!ModelState.IsValid) { //model errors so return immediately return(View(new DetailPostViewModels { Comment = comment, DetailPostDto = serviceDetail.GetDetail <DetailPostDto>(comment.PostId).Result })); } var response = service.Create(comment); if (response.IsValid) { TempData["message"] = response.SuccessMessage; return(RedirectToAction("PostDetails")); } //else errors, so copy the errors over to the ModelState and return to view response.CopyErrorsToModelState(ModelState, comment); return(View(new DetailPostViewModels { Comment = comment, DetailPostDto = serviceDetail.GetDetail <DetailPostDto>(comment.PostId).Result })); }
public ActionResult PostDetails(int id, IDetailService service) { return(View(new DetailPostViewModels { Comment = new Comment(), DetailPostDto = service.GetDetail <DetailPostDto>(id).Result })); }
public ActionResult Details(int id, IDetailService service) { return(View(service.GetDetail <CrudCustomerDto>(id).Result)); }
public ActionResult Details(int id, IDetailService service) { return(View(service.GetDetail <DetailPostDto>(id).Result)); }
public ActionResult Details(int id, IDetailService service) { return View(service.GetDetail<Tag>(id).Result); }
public ActionResult Details(int id, IDetailService service) { return View(service.GetDetail<CrudSalesOrderDto>(id).Result); }