Skip to content

Commit

Permalink
⬆️ Update to .NET 9 (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
MattParkerDev authored Jan 14, 2025
1 parent 22873c6 commit 62260f5
Show file tree
Hide file tree
Showing 17 changed files with 74 additions and 72 deletions.
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.202",
"version": "9.0.101",
"rollForward": "latestFeature",
"allowPrerelease": false
}
Expand Down
4 changes: 2 additions & 2 deletions src/Application/Application.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Betalgo.OpenAI" Version="6.8.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.3">
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
4 changes: 2 additions & 2 deletions src/Domain/Domain.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Betalgo.OpenAI" Version="6.8.6" />
<PackageReference Include="Pgvector.EntityFrameworkCore" Version="0.2.0" />
<PackageReference Include="Pgvector.EntityFrameworkCore" Version="0.2.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Shared\Shared.csproj" />
Expand Down
10 changes: 5 additions & 5 deletions src/Infrastructure/Infrastructure.csproj
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.3">
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="8.0.3" />
<PackageReference Include="Microsoft.SemanticKernel" Version="1.6.1" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.2" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="9.0.0" />
<PackageReference Include="Microsoft.SemanticKernel" Version="1.33.0" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.2" />
<PackageReference Include="Polly" Version="8.3.1" />
<PackageReference Include="Polly.Extensions.Http" Version="3.0.0" />
<PackageReference Include="supabase-csharp" Version="0.9.1" />
Expand Down
2 changes: 1 addition & 1 deletion src/Shared/Shared.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>Shared</RootNamespace>
Expand Down
26 changes: 13 additions & 13 deletions src/WebAPI/WebAPI.csproj
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>17bf44ff-ae99-4c7f-bd85-6079c97fc83d</UserSecretsId>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Azure.Identity" Version="1.10.4" />
<PackageReference Include="Microsoft.AspNetCore.ApiAuthorization.IdentityServer" Version="7.0.17" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="8.0.3" />
<PackageReference Include="Azure.Identity" Version="1.13.1" />
<PackageReference Include="Microsoft.AspNetCore.ApiAuthorization.IdentityServer" Version="7.0.20" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="9.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="9.0.0" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.22.0" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.3" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.0" />
<PackageReference Include="Duende.BFF" Version="1.1.0" />
<PackageReference Include="Microsoft.Azure.AppConfiguration.AspNetCore" Version="7.1.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.3" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore" Version="8.0.3" />
<PackageReference Include="NSwag.AspNetCore" Version="14.0.3" />
<PackageReference Include="NSwag.MSBuild" Version="14.0.3">
<PackageReference Include="Microsoft.Azure.AppConfiguration.AspNetCore" Version="8.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore" Version="9.0.0" />
<PackageReference Include="NSwag.AspNetCore" Version="14.2.0" />
<PackageReference Include="NSwag.MSBuild" Version="14.2.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand All @@ -36,6 +36,6 @@
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
</PropertyGroup>
<Target Name="SwaggerPostBuildClientAndSpec" AfterTargets="PostBuildEvent" Condition=" '$(Configuration)' == 'Debug' ">
<Exec WorkingDirectory="$(ProjectDir)" EnvironmentVariables="ASPNETCORE_ENVIRONMENT=Development" Command="$(NSwagExe_Net80) run nswag.json /variables:Configuration=$(Configuration)" />
<Exec WorkingDirectory="$(ProjectDir)" EnvironmentVariables="ASPNETCORE_ENVIRONMENT=Development" Command="$(NSwagExe_Net90) run nswag.json /variables:Configuration=$(Configuration)" />
</Target>
</Project>
2 changes: 1 addition & 1 deletion src/WebAPI/nswag.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"runtime": "Net80",
"runtime": "Net90",
"defaultVariables": null,
"documentGenerator": {
"aspNetCoreToOpenApi": {
Expand Down
2 changes: 1 addition & 1 deletion src/WebUI/Components/ChatItem.razor
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
}
</style>

<MudListItem>
<MudListItem T="ChatLinkedListItem">
@if (isUser)
{
<div class="item-root">
Expand Down
6 changes: 3 additions & 3 deletions src/WebUI/Components/Dialogs/ApiKeyDialog.razor
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
<MudDialog>
<DialogContent>
<MudStack>
<MudSwitch @bind-Checked="@UsingByoApiKey" Label="Use my API Key" Color="Color.Error"></MudSwitch>
<MudSwitch @bind-value="@UsingByoApiKey" Label="Use my API Key" Color="Color.Error"></MudSwitch>
@if (UsingByoApiKey)
{
<MudSwitch Class="mb-2" @bind-Checked="@SaveAPIKeyToLocalStorage" Label="Save to LocalStorage" Color="Color.Error"></MudSwitch>
<MudSwitch Class="mb-2" @bind-Value="@SaveAPIKeyToLocalStorage" Label="Save to LocalStorage" Color="Color.Error"></MudSwitch>
}
<MudSelect Disabled="@(!UsingByoApiKey && !UserService.IsUserAuthenticated)" T="AvailableGptModels" @bind-Value="@SelectedGptModel" ToStringFunc="s => s.AvailableModelEnumToString()" Label="GPT Model" AnchorOrigin="Origin.BottomCenter">
<MudSelectItem Value="AvailableGptModels.Gpt35Turbo"/>
Expand All @@ -30,7 +30,7 @@
<MudButton StartIcon="@Icons.Material.Filled.Help" OnClick="OpenHelp">Help</MudButton>
}
</MudStack>
<MudDialog @bind-IsVisible="HelpIsVisible">
<MudDialog @bind-Visible="HelpIsVisible">
<DialogContent>
<MudText Class="mb-2" Typo="Typo.h6">How to get an API Key</MudText>
<MudText>
Expand Down
4 changes: 2 additions & 2 deletions src/WebUI/Components/RulesBotChat.razor
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


<div style="display: grid; grid-template-rows: 1fr auto; height: 100%; padding: 24px 0;">
<MudPaper Elevation="0" Style=@($"background: {(!isDarkMode ? Theme.Palette.BackgroundGrey : Theme.PaletteDark.BackgroundGrey)}; border: 1px solid #e6e6e6; overflow-y: auto; height: 100%")>
<MudPaper Elevation="0" Style=@($"background: {(!isDarkMode ? Theme.PaletteLight.BackgroundGray : Theme.PaletteDark.BackgroundGray)}; border: 1px solid #e6e6e6; overflow-y: auto; height: 100%")>
<MudContainer Class="pa-0" Style="height: 100%">
@if (DataState.Conversation.ChatList.Count == 0)
{
Expand Down Expand Up @@ -41,7 +41,7 @@
}
else
{
<MudList Class="py-0 chatContainer" DisableGutters="true">
<MudList T="ChatLinkedListItem" Class="py-0 chatContainer" Gutters="false">
@foreach (var message in DataState.Conversation.CurrentThread.Where(s => s.Message.Role != "system"))
{
<ChatItem MessageThreadItem="message"/>
Expand Down
6 changes: 3 additions & 3 deletions src/WebUI/Pages/Leaderboard.razor
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@
<MudButtonGroup OverrideStyles="false">
<MudButton
Color="Color.Error"
DisableElevation="true"
DropShadow="false"
Variant="@(Filter == LeaderboardFilter.LastMonth ? Variant.Filled : Variant.Outlined)"
OnClick="@(() => HandleFilterChanged(LeaderboardFilter.LastMonth))">
Last Month
</MudButton>
<MudButton
Color="Color.Error"
DisableElevation="true"
DropShadow="false"
Variant="@(Filter == LeaderboardFilter.LastYear ? Variant.Filled : Variant.Outlined)"
OnClick="@(() => HandleFilterChanged(LeaderboardFilter.LastYear))">
Last Year
</MudButton>
<MudButton
Color="Color.Error"
DisableElevation="true"
DropShadow="false"
Variant="@(Filter == LeaderboardFilter.AllTime ? Variant.Filled : Variant.Outlined)"
OnClick="@(() => HandleFilterChanged(LeaderboardFilter.AllTime))">
All Time
Expand Down
28 changes: 16 additions & 12 deletions src/WebUI/RulesGptApiClients.cs
Original file line number Diff line number Diff line change
@@ -1,38 +1,40 @@
//----------------------
// <auto-generated>
// Generated using the NSwag toolchain v14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org)
// Generated using the NSwag toolchain v14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org)
// </auto-generated>
//----------------------

#pragma warning disable 108 // Disable "CS0108 '{derivedDto}.ToJson()' hides inherited member '{dtoBase}.ToJson()'. Use the new keyword if hiding was intended."
#pragma warning disable 114 // Disable "CS0114 '{derivedDto}.RaisePropertyChanged(String)' hides inherited member 'dtoBase.RaisePropertyChanged(String)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword."
#pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?'
#pragma warning disable 612 // Disable "CS0612 '...' is obsolete"
#pragma warning disable 649 // Disable "CS0649 Field is never assigned to, and will always have its default value null"
#pragma warning disable 1573 // Disable "CS1573 Parameter '...' has no matching param tag in the XML comment for ...
#pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..."
#pragma warning disable 8073 // Disable "CS8073 The result of the expression is always 'false' since a value of type 'T' is never equal to 'null' of type 'T?'"
#pragma warning disable 3016 // Disable "CS3016 Arrays as attribute arguments is not CLS-compliant"
#pragma warning disable 8603 // Disable "CS8603 Possible null reference return"
#pragma warning disable 8604 // Disable "CS8604 Possible null reference argument for parameter"
#pragma warning disable 8625 // Disable "CS8625 Cannot convert null literal to non-nullable reference type"
#pragma warning disable 8765 // Disable "CS8765 Nullability of type of parameter doesn't match overridden member (possibly because of nullability attributes)."

namespace WebUI
{
using System = global::System;

[System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
[System.CodeDom.Compiler.GeneratedCode("NSwag", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class RulesGptClient
{
#pragma warning disable 8618
private string _baseUrl;
#pragma warning restore 8618

private System.Net.Http.HttpClient _httpClient;
private static System.Lazy<System.Text.Json.JsonSerializerOptions> _settings = new System.Lazy<System.Text.Json.JsonSerializerOptions>(CreateSerializerSettings, true);
private System.Text.Json.JsonSerializerOptions _instanceSettings;

#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
public RulesGptClient(System.Net.Http.HttpClient httpClient)
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
{
_httpClient = httpClient;
Initialize();
}

private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings()
Expand All @@ -42,10 +44,12 @@ private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings()
return settings;
}

protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } }
protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _instanceSettings ?? _settings.Value; } }

static partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings);

partial void Initialize();

partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url);
partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder);
partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response);
Expand Down Expand Up @@ -629,7 +633,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu
}
}

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class LeaderboardUser
{

Expand All @@ -650,7 +654,7 @@ public partial class LeaderboardUser

}

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class ConversationHistoryModel
{

Expand All @@ -674,7 +678,7 @@ public partial class ConversationHistoryModel

}

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class ChatHistoryDetail
{

Expand All @@ -688,7 +692,7 @@ public partial class ChatHistoryDetail



[System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
[System.CodeDom.Compiler.GeneratedCode("NSwag", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class ApiException : System.Exception
{
public int StatusCode { get; private set; }
Expand All @@ -711,7 +715,7 @@ public override string ToString()
}
}

[System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
[System.CodeDom.Compiler.GeneratedCode("NSwag", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class ApiException<TResult> : ApiException
{
public TResult Result { get; private set; }
Expand Down
3 changes: 0 additions & 3 deletions src/WebUI/Services/DialogService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ public async Task<bool> ApiKeyDialog()
{
CloseOnEscapeKey = true,
CloseButton = true,
DisableBackdropClick = false,
NoHeader = false,
MaxWidth = MaxWidth.ExtraSmall
};
Expand All @@ -33,7 +32,6 @@ public async Task<bool> AboutRulesGptDialog()
{
CloseOnEscapeKey = true,
CloseButton = true,
DisableBackdropClick = false,
NoHeader = false,
MaxWidth = MaxWidth.Small,

Expand All @@ -49,7 +47,6 @@ public async Task<bool> InstallInstructionsDialog()
{
CloseOnEscapeKey = true,
CloseButton = true,
DisableBackdropClick = false,
NoHeader = false,
MaxWidth = MaxWidth.Large
};
Expand Down
Loading

0 comments on commit 62260f5

Please sign in to comment.