// Update course credits
        public static CourseUpdateCredits.Response Handle(IRepository repository, CourseUpdateCredits.Request request)
        {
            var rowsAffected = repository.ExecuteStoredProcudure(
                "UPDATE Course SET Credits = Credits * {0}",
                request.CommandModel.Multiplier);

            return(new CourseUpdateCredits.Response(rowsAffected));
        }
        public CourseUpdateCredits.Request CreateValidRequest(params Action<CourseUpdateCredits.Request>[] updates)
        {
            var commandModel = EntityGenerator.Create<CourseUpdateCredits.CommandModel>();

            var request = new CourseUpdateCredits.Request("UserId", commandModel);
            updates.ToList().ForEach(func => func(request));
            return request;
        }
        public CourseUpdateCredits.Request CreateValidRequest(params Action <CourseUpdateCredits.Request>[] updates)
        {
            var commandModel = EntityGenerator.Create <CourseUpdateCredits.CommandModel>();

            var request = new CourseUpdateCredits.Request("UserId", commandModel);

            updates.ToList().ForEach(func => func(request));
            return(request);
        }
        public ActionResult UpdateCourseCredits(int? multiplier)
        {
            if (multiplier != null)
            {
                var request = new CourseUpdateCredits.Request(SystemPrincipal.Name, new CourseUpdateCredits.CommandModel { Multiplier = multiplier.Value });
                var response = DomainServices.Dispatch<CourseUpdateCredits.Response>(request);

                ViewBag.RowsAffected = response.RowsEffected;
            }

            return View();
        }
        public ActionResult UpdateCourseCredits(int?multiplier)
        {
            if (multiplier != null)
            {
                var request = new CourseUpdateCredits.Request(SystemPrincipal.Name, new CourseUpdateCredits.CommandModel {
                    Multiplier = multiplier.Value
                });
                var response = DomainServices.Dispatch <CourseUpdateCredits.Response>(request);

                ViewBag.RowsAffected = response.RowsEffected;
            }

            return(View());
        }