public void WhenIChangeTheCourseTitleTo(string title)
 {
     var cmd = new ChangeCourseTitleCommand()
                   {
                       CourseId = DomainHelper.GetEventSourceId<Course>(),
                       NewTitle = title
                   };
     DomainHelper.WhenExecuting(cmd);
 }
Ejemplo n.º 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));
        }