private async Task ProcessTracker(TrackerHashDto t, List <TrackingDto> trackingDtoCollection) { var result = await _telemetryCollectionFunction.CallDeserializingToObjectAsync <TelemetrySmartContractDto>(t.TransactionId, 0); trackingDtoCollection.Add(new TrackingDto(t.TransactionId, result.GpsLat, result.GpsLong, result.TemperatureInCelcius, result.Sender, result.DeviceId, t.TransactionHash, new DateTime(result.TimeSpanInTicks))); }
public async Task PublishAsync(TrackerHashDto trackerHashDto) { if (trackerHashDto == null) { throw new ArgumentNullException(nameof(trackerHashDto)); } await _trackerStoreRepository.InsertAsync(trackerHashDto); }
public async Task InsertAsync(TrackerHashDto trackerHashDto) { if (trackerHashDto == null) { throw new ArgumentNullException(nameof(trackerHashDto)); } try { await _documentClient.CreateDocumentAsync(UriFactory.CreateDocumentCollectionUri(_databaseName, _documentCollectionName), trackerHashDto); } catch (Exception ex) { throw new Exception( $"Failed to add TrackerHashDto to database {_databaseName} in collection {_documentCollectionName}", ex); } }
public async Task PublishAsync(TrackerHashDto trackerHashDto) { try { // now invoke the service fabric service. await _trackerStoreService.PublishAsync(trackerHashDto); } catch (FabricServiceNotFoundException notFoundex) { throw new Exception( $"Unable to communicate with the TrackerStoreService to publish tracker hashes. Reason: {notFoundex.Message} "); } catch (Exception ex) { throw new Exception( $"Unable to communicate with the TrackerStoreService to publish tracker hashes. Reason: {ex.Message}"); } }