Example #1
0
        protected override void DoHandle(ChangeName command)
        {
            var martialArtist = _martialArtistRepository.GetById(command.UserId);

            martialArtist.ChangeNameTo(command.Name);
            _martialArtistRepository.Store(martialArtist);
        }
Example #2
0
        protected override void DoHandle(ChangeBio command)
        {
            var ma = _martialArtistRepository.GetById(command.UserId);

            ma.ChangeBioTo(command.Biography);
            _martialArtistRepository.Store(ma);
        }
Example #3
0
        protected override void DoHandle(DeleteDojo command)
        {
            var dojo = _dojoRepository.GetById(command.DojoId);

            dojo.RemoveFromSite();
            _dojoRepository.Store(dojo);
        }
Example #4
0
        protected override void DoHandle(RegisterStudent command)
        {
            var dojo    = _dojoRepository.GetById(command.DojoId);
            var student = _martialArtistRepository.GetById(command.StudentId);

            dojo.Register(student);
            _dojoRepository.Store(dojo);
        }
Example #5
0
        protected override void DoHandle(EditMartialArtistInfo command)
        {
            var ma = _martialArtistRepository.GetById(command.UserId);

            if (!String.IsNullOrEmpty(command.Name))
            {
                ma.ChangeNameTo(command.Name);
            }
            if (!String.IsNullOrEmpty(command.Biography))
            {
                ma.ChangeBioTo(command.Biography);
            }
            _martialArtistRepository.Store(ma);
        }
Example #6
0
        protected override void DoHandle(CreateNewDojo command)
        {
            var user = _userRepo.GetById(command.UserId);

            user.CreateDojoWithId(command.SchoolId);
            _userRepo.Store(user);

            var dojo = _dojoRepo.GetById(command.SchoolId);

            dojo.ChangeNameTo(command.Name)
            .ChangeAddressTo(command.Address)
            .ChangeDescription(command.Description);

            _dojoRepo.Store(dojo);
        }