public async Task MessageHandler(ProcessMessageEventArgs args) { string body = args.Message.Body.ToString(); var wantedList = _repo.RetrieveWantedList(); var lp = JsonSerializer.Deserialize <LicensePlatePayload>(body); //await _licenseService.SendPlate(lp); if (wantedList.Contains(lp.LicensePlate)) { var filePath = _fileRepo.ReadImage(lp.ContextImageJpg, lp.LicensePlate); var uri = await _blob.Upload(filePath); _fileRepo.CleanFiles(filePath); lp.ContextImageReference = uri; Console.WriteLine($"Sending:\n{lp.LicensePlateCaptureTime}\n{lp.LicensePlate}\n{lp.Longitude}\n{lp.Latitude}\n{uri}"); var code = await _licenseService.SendPlate(lp); } // complete the message. messages is deleted from the queue. await args.CompleteMessageAsync(args.Message); }
public async Task MessageHandler(ProcessMessageEventArgs args) { string body = args.Message.Body.ToString(); Console.WriteLine($"NOTIFIED: {body}"); var wanted = await _licenseService.GetWantedList(); var currentList = _azureRepository.RetrieveWantedList(); //Store wanted plates into table foreach (var w in wanted) { if (currentList.Contains(w)) { continue; } await _azureRepository.StoreLicensePlate(w); } // complete the message. messages is deleted from the queue. await args.CompleteMessageAsync(args.Message); }