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)); }
public void Handle(RemoveDeveloperCommand message) { this.HandleRemove(message.AcSession, message.AccountId, true); }
public void Remove(int id) { var removeCommand = new RemoveDeveloperCommand(id); bus.SendCommand(removeCommand); }