Esempio n. 1
0
        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));
        }
Esempio n. 2
0
 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));
 }