public Task <DeleteCustomerGroupResponse> deleteCustomerGroup(DeleteCustomerGroupRequest request) { DeleteCustomerGroupCommand command = new DeleteCustomerGroupCommand(request.Id); Task <object> CustomerGroup = (Task <object>)Bus.SendCommand(command); //RabbitMQBus.Publish(command); DeleteCustomerGroupResponse response = new DeleteCustomerGroupResponse(); response = Common <DeleteCustomerGroupResponse> .checkHasNotification(_notifications, response); return(Task.FromResult(response)); }
public Task <object> Handle(DeleteCustomerGroupCommand command, CancellationToken cancellationToken) { if (!command.IsValid(_CustomerGroupRepository)) { NotifyValidationErrors(command); return(Task.FromResult(false as object)); } else { bool result = _CustomerGroupRepository.Delete(command.Id); return(Task.FromResult(true as object)); } }