Beispiel #1
0
        public Task <DeletePreservationResponse> deletePreservation(DeletePreservationRequest request)
        {
            DeletePreservationCommand command      = new DeletePreservationCommand(request.Id);
            Task <object>             Preservation = (Task <object>)Bus.SendCommand(command);
            //RabbitMQBus.Publish(command);
            DeletePreservationResponse response = new DeletePreservationResponse();

            response = Common <DeletePreservationResponse> .checkHasNotification(_notifications, response);

            return(Task.FromResult(response));
        }
Beispiel #2
0
 public Task <object> Handle(DeletePreservationCommand command, CancellationToken cancellationToken)
 {
     if (!command.IsValid(_PreservationRepository))
     {
         NotifyValidationErrors(command);
         return(Task.FromResult(false as object));
     }
     else
     {
         bool result = _PreservationRepository.Delete(command.Id);
         return(Task.FromResult(true as object));
     }
 }