diff --git a/GeocodeLocations.cs b/GeocodeLocations.cs index fcad983e0..d9fa8acbf 100644 --- a/GeocodeLocations.cs +++ b/GeocodeLocations.cs @@ -1,4 +1,5 @@ -using System.Collections.Concurrent; +using System; +using System.Collections.Concurrent; using System.Collections.Generic; using System.IO; using System.Net.Http; @@ -22,13 +23,16 @@ public class GeocodeLocations : Module // Cache responses for each location private readonly ConcurrentDictionary> _coordinateCache = - new ConcurrentDictionary>(); + new ConcurrentDictionary>(StringComparer.OrdinalIgnoreCase); private readonly Config _subscriptionKey; public GeocodeLocations(Config subscriptionKey) { _subscriptionKey = subscriptionKey.ThrowIfNull(nameof(subscriptionKey)); + + // Add coordinate overrides to cache + _coordinateCache["the netherlands"] = Task.FromResult(new CoordinateAbbreviated { Lat = 52.371807, Lon = 4.896029 }); } protected override async Task> ExecuteInputAsync(IDocument input, IExecutionContext context)