-
Notifications
You must be signed in to change notification settings - Fork 1
/
GeocodioClient.linq
54 lines (46 loc) · 1.38 KB
/
GeocodioClient.linq
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<Query Kind="Program">
<Reference Relative="Arex388.Geocodio\bin\Debug\netstandard2.0\Arex388.Geocodio.dll">E:\Software Development\Arex388.Geocodio\Arex388.Geocodio\bin\Debug\netstandard2.0\Arex388.Geocodio.dll</Reference>
<NuGetReference>Microsoft.Extensions.Http</NuGetReference>
<Namespace>Arex388.Geocodio</Namespace>
<Namespace>Microsoft.Extensions.DependencyInjection</Namespace>
<Namespace>System.Threading.Tasks</Namespace>
<Namespace>System.Text.Json</Namespace>
</Query>
private static readonly GeocodioClientOptions _options = new GeocodioClientOptions {
Key = Util.GetPassword("geocodiokey")
};
async Task Main() {
//var geocodio = GetClientMultiple();
var geocodio = GetClientSingle();
(await geocodio.GeocodeAsync("4022 W Camino del Rio, Glendale, AZ 85310").ConfigureAwait(false)).Dump();
}
public IGeocodioClient GetClientMultiple() {
var services = new ServiceCollection().AddGeocodio().BuildServiceProvider();
var geocodioFactory = services.GetRequiredService<IGeocodioClientFactory>();
return geocodioFactory.CreateClient(_options);
}
public IGeocodioClient GetClientSingle() {
var services = new ServiceCollection().AddGeocodio(_options).BuildServiceProvider();
return services.GetRequiredService<IGeocodioClient>();
}
// ============================================================================
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
// EoF