public RedirectToRouteResult Edit(Activity activity) { if (ModelState.IsValid) { _mediator.Send(new EditActivityCommand(activity)); } return this.RedirectToAction(c => c.Edit(activity.Id)); }
public RedirectToRouteResult Create(Activity activity) { if (!ModelState.IsValid) { return this.RedirectToAction(c => c.Create()); } var newActivityId = _mediator.Send(new CreateActivityCommand(activity)); return this.RedirectToAction(c => c.Edit(newActivityId)); }