コード例 #1
0
 public RedirectToRouteResult Edit(Activity activity)
 {
     if (ModelState.IsValid)
     {
         _mediator.Send(new EditActivityCommand(activity));
     }
     
     return this.RedirectToAction(c => c.Edit(activity.Id));
 }
コード例 #2
0
        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));
        }