private void QueueMpi(SendManifestPackageDTO package) { var client = new BackgroundJobClient(); var state = new EnqueuedState("mpi"); client.Create(() => _cbsSendService.SendMpiAsync(package), state); }
public void should_Send_Mpi() { _sendService.Client = new HttpClient(_mpiHandlerMock.Object); var sendTo = new SendManifestPackageDTO(_registry); var responses = _sendService.SendMpiAsync(sendTo).Result; Assert.NotNull(responses); Assert.False(responses.Select(x => x.IsValid()).Any(x => false)); responses.ForEach(sendMpiResponse => Log.Debug($"SENT! > {sendMpiResponse}")); }
public void should_Send_Mpi() { var sendTo = new SendManifestPackageDTO(_registry); var responses = _cbsSendService.SendMpiAsync(sendTo, _mpiBag).Result; Assert.NotNull(responses); Assert.False(responses.Select(x => x.IsValid()).Any(x => false)); foreach (var sendManifestResponse in responses) { Console.WriteLine(sendManifestResponse); } }
public async Task <IActionResult> SendMpi([FromBody] SendManifestPackageDTO packageDTO) { if (!packageDTO.IsValid()) { return(BadRequest()); } try { await _cbsSendService.SendMpiAsync(packageDTO); return(Ok()); } catch (Exception e) { var msg = $"Error sending {nameof(MasterPatientIndex)} {e.Message}"; Log.Error(e, msg); return(StatusCode(500, msg)); } }