Пример #1
0
 public static void Run([QueueTrigger("lgsequeuedev", Connection = "AzureWebJobsStorage")] string myQueueItem, ILogger log)
 {
     try
     {
         logger = log;
         logger.LogInformation($"C# Queue trigger function processed: {myQueueItem}");
         BingMapUtility  bingMapUtility = new BingMapUtility();
         IncidentRequest incReq         = JsonConvert.DeserializeObject <IncidentRequest>(myQueueItem);
         var             entities       = bingMapUtility.MPRNStoEntitiesConverter(incReq);
         bingMapUtility.GeoCode(entities, incReq.Id);
     }
     catch (Exception ex)
     {
         logger.LogError(ex.Message + " " + ex.StackTrace + " " + ex.InnerException);
     }
 }
Пример #2
0
        public List <GeocodeEntity> MPRNStoEntitiesConverter(IncidentRequest incReq)
        {
            List <GeocodeEntity> resGeoCodesEntList = new List <GeocodeEntity>();

            if (incReq.MPRNs != null)
            {
                foreach (var item in incReq.MPRNs)
                {
                    var query = GetQueryforMPRN(item);
                    resGeoCodesEntList.Add(new GeocodeEntity(query)
                    {
                        Id = item.MPRN
                    });
                }
            }
            return(resGeoCodesEntList);
        }