Example #1
0
        public Task <bool> Handle(RemoveDeveloperCommand request, CancellationToken cancellationToken)
        {
            if (!request.IsValid())
            {
                NotifyValidationErrors(request);
                return(Task.FromResult(false));
            }

            var model = developerRepository.GetById(request.Id);

            if (model == null)
            {
                NotifyValidationErrors(request);
                return(Task.FromResult(false));
            }
            model.EntityState = EntityStateOptions.Deleted;

            developerRepository.Update(model);

            if (Commit())
            {
                bus.RaiseEvent(new DeveloperRemovedEvent(model.Id));
            }
            return(Task.FromResult(true));
        }
Example #2
0
 public void Handle(RemoveDeveloperCommand message)
 {
     this.HandleRemove(message.AcSession, message.AccountId, true);
 }
Example #3
0
        public void Remove(int id)
        {
            var removeCommand = new RemoveDeveloperCommand(id);

            bus.SendCommand(removeCommand);
        }