A lightweight method for communicating with the Bing geocoding APIs. This includes models and interfaces for calling Bing.
$ dotnet add package Geo.BingThis allows the simple calling of Bing geocoding APIs. The supported Bing geocoding endpoints are:
In the startup ConfigureServices method, add the configuration for the Bing service:
using Geo.Extensions.DependencyInjection;
.
.
.
public void ConfigureServices(IServiceCollection services)
{
.
.
.
var builder = services.AddBingGeocoding();
builder.AddKey(your_bing_api_key_here);
builder.HttpClientBuilder.ConfigureHttpClient(configure_client);
.
.
.
}
By calling AddBingGeocoding, the IBingGeocoding interface has been added to the IOC container. Just request it as a DI item:
public MyService(IBingGeocoding bingGeocoding)
{
...
}
Now simply call the geocoding methods in the interface.