public IList <Tuple <Entry, FhirResponse> > HandleTransaction(Bundle bundle, IInteractionHandler interactionHandler) { if (interactionHandler == null) { throw new InvalidOperationException("Unable to run transaction operation"); } var entries = new List <Entry>(); Mapper <string, IKey> mapper = new Mapper <string, IKey>(); foreach (var operation in bundle.Entry.Select(e => ResourceManipulationOperationFactory.GetManipulationOperation(e, localhost, searchService))) { IList <Entry> atomicOperations = operation.GetEntries().ToList(); AddMappingsForOperation(mapper, operation, atomicOperations); entries.AddRange(atomicOperations); } return(HandleTransaction(entries, interactionHandler, mapper)); }
public async Task <IList <Tuple <Entry, FhirResponse> > > HandleTransaction( Bundle bundle, IInteractionHandler interactionHandler) { if (interactionHandler == null) { throw new InvalidOperationException("Unable to run transaction operation"); } var entries = new List <Entry>(); var mapper = new Mapper <string, IKey>(); foreach (var task in bundle.Entry.Select( e => ResourceManipulationOperationFactory.GetManipulationOperation(e, _localhost, _searchService))) { var operation = await task.ConfigureAwait(false); IList <Entry> atomicOperations = operation.GetEntries().ToList(); AddMappingsForOperation(mapper, operation, atomicOperations); entries.AddRange(atomicOperations); } return(await HandleTransaction(entries, interactionHandler, mapper).ConfigureAwait(false)); }