added ApiClient
This commit is contained in:
@@ -5,8 +5,8 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
|
||||
<UserSecretsId>c93b84d8-b4e9-4725-84e3-00a10f74073f</UserSecretsId>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia" Version="11.3.12" />
|
||||
<PackageReference Include="Avalonia.Desktop" Version="11.3.12" />
|
||||
@@ -17,5 +17,14 @@
|
||||
<IncludeAssets Condition="'$(Configuration)' != 'Debug'">None</IncludeAssets>
|
||||
<PrivateAssets Condition="'$(Configuration)' != 'Debug'">All</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="10.0.5" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="10.0.5" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="10.0.5" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="10.0.5" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
|
||||
<PackageReference Include="NSwag.ApiDescription.Client" Version="14.6.3" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<OpenApiReference Include="DigitalDojoApi.json" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
1253
DDApp/DDApplication/DigitalDojoApi.json
Normal file
1253
DDApp/DDApplication/DigitalDojoApi.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,9 +1,11 @@
|
||||
using System;
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace DDApplication;
|
||||
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
private readonly string _apiKey = Program.Configuration["APIKEY"] ?? throw new ArgumentNullException(nameof(_apiKey));
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
@@ -1,16 +1,26 @@
|
||||
using Avalonia;
|
||||
using System;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
|
||||
namespace DDApplication;
|
||||
|
||||
internal static class Program
|
||||
internal class Program
|
||||
{
|
||||
public static IConfiguration Configuration { get; private set; } = null!;
|
||||
// Initialization code. Don't use any Avalonia, third-party APIs or any
|
||||
// SynchronizationContext-reliant code before AppMain is called: things aren't initialized
|
||||
// yet and stuff might break.
|
||||
[STAThread]
|
||||
public static void Main(string[] args) => BuildAvaloniaApp()
|
||||
public static int Main(string[] args)
|
||||
{
|
||||
Configuration = new ConfigurationBuilder()
|
||||
.AddJsonFile("appsettings.json", optional: true)
|
||||
.AddUserSecrets<Program>(optional: true)
|
||||
.AddEnvironmentVariables()
|
||||
.Build();
|
||||
return BuildAvaloniaApp()
|
||||
.StartWithClassicDesktopLifetime(args);
|
||||
}
|
||||
|
||||
// Avalonia configuration, don't remove; also used by visual designer.
|
||||
private static AppBuilder BuildAvaloniaApp()
|
||||
|
||||
Reference in New Issue
Block a user