public Task <DeleteProductRequestResponse> deleteProductRequest(int id) { DeleteProductRequestCommand command = new DeleteProductRequestCommand ( id ); Task <object> ProductRequest = (Task <object>)Bus.SendCommand(command); DeleteProductRequestResponse response = new DeleteProductRequestResponse(); response = Common <DeleteProductRequestResponse> .checkHasNotification(_notifications, response); return(Task.FromResult(response)); }
public Task <object> Handle(DeleteProductRequestCommand command, CancellationToken cancellationToken) { if (!command.IsValid()) { NotifyValidationErrors(command); } else { bool result = _ProductRequestRepository.Delete(command.Id); return(Task.FromResult(result as object)); } return(Task.FromResult(false as object)); }