Revize 4b0f0b36
Přidáno uživatelem Pultak před asi 3 roky(ů)
ld_client/LDClient/LDClient.csproj | ||
---|---|---|
24 | 24 |
</ItemGroup> |
25 | 25 |
|
26 | 26 |
<ItemGroup> |
27 |
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" /> |
|
27 | 28 |
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" /> |
29 |
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" /> |
|
30 |
<PackageReference Include="RestSharp" Version="107.3.0" /> |
|
28 | 31 |
<PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.0" /> |
29 | 32 |
</ItemGroup> |
30 | 33 |
|
ld_client/LDClient/Program.cs | ||
---|---|---|
1 |
using LDClient.utils; |
|
1 |
using LDClient.network; |
|
2 |
using LDClient.utils; |
|
2 | 3 |
using LDClient.utils.loggers; |
3 | 4 |
|
4 | 5 |
namespace LDClient; |
5 | 6 |
|
6 | 7 |
internal class Program { |
7 | 8 |
|
8 |
public static ConfigLoader Config { get; set; } = null!; |
|
9 |
public static ConfigLoader Config { get; set; } = new(); |
|
10 |
public static ALogger DefaultLogger { get; } = ALogger.Current; |
|
9 | 11 |
|
10 |
// Main Method |
|
11 |
public static void Main() { |
|
12 |
Config = new ConfigLoader(); |
|
12 |
public static IApiClient DefaultApiClient { get; set; } = new ApiClient(Config.ApiBaseAddress, |
|
13 |
Config.ApiPort, Config.ApiUsbEndPoint, Config.ApiRetryPeriod); |
|
13 | 14 |
|
14 |
while (true) { |
|
15 |
ALogger.Current.Info("Ok"); |
|
16 |
ALogger.Current.Debug("Debug"); |
|
17 |
ALogger.Current.Error("Error"); |
|
18 |
} |
|
15 |
// Main Method |
|
16 |
public static async Task Main() { |
|
17 |
await DefaultApiClient.SendPayloadAsync(ApiClient.ExampleInfo); |
|
18 |
Console.WriteLine("Finished!"); |
|
19 | 19 |
} |
20 | 20 |
} |
Také k dispozici: Unified diff
re #9438 project structure definition + main example