public void WhenIChangeTheCourseTitleTo(string title)
 {
     var cmd = new ChangeCourseTitleCommand()
                   {
                       CourseId = DomainHelper.GetEventSourceId<Course>(),
                       NewTitle = title
                   };
     DomainHelper.WhenExecuting(cmd);
 }
Beispiel #2
0
        public RedirectToRouteResult ChangeTitle(ChangeCourseTitleCommand command)
        {
            if (!ModelState.IsValid)
                return this.RedirectToAction(c => c.ChangeTitle(command.CourseId));

            _commandService.Execute(command);
            return this.RedirectToAction(c => c.Details(command.CourseId));
        }