-
Notifications
You must be signed in to change notification settings - Fork 0
/
CarmineClient.linq
51 lines (44 loc) · 1.22 KB
/
CarmineClient.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
<Query Kind="Program">
<Reference Relative="Arex388.Carmine\bin\Debug\netstandard2.0\Arex388.Carmine.dll">E:\Software Development\Arex388.Carmine\Arex388.Carmine\bin\Debug\netstandard2.0\Arex388.Carmine.dll</Reference>
<NuGetReference>Microsoft.Extensions.Http</NuGetReference>
<Namespace>Arex388.Carmine</Namespace>
<Namespace>Microsoft.Extensions.DependencyInjection</Namespace>
<Namespace>System.Threading.Tasks</Namespace>
</Query>
private static readonly CarmineClientOptions _options = new CarmineClientOptions {
Key = Util.GetPassword("carmine.key")
};
async Task Main() {
//var carmine = GetClientMultiple();
var carmine = GetClientSingle();
}
public ICarmineClient GetClientMultiple() {
var services = new ServiceCollection().AddCarmine().BuildServiceProvider();
var carmineFactory = services.GetRequiredService<ICarmineClientFactory>();
return carmineFactory.CreateClient(_options);
}
public ICarmineClient GetClientSingle() {
var services = new ServiceCollection().AddCarmine(_options).BuildServiceProvider();
return services.GetRequiredService<ICarmineClient>();
}
// ============================================================================
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
// EoF