Skip to content

Commit

Permalink
Updated to .NET 6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
pmachapman committed Nov 10, 2021
1 parent 1bf0f9b commit adb39b3
Show file tree
Hide file tree
Showing 24 changed files with 56 additions and 245 deletions.
2 changes: 1 addition & 1 deletion GoToBible.Engine/GoToBible.Engine.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>GoToBible.Engine.snk</AssemblyOriginatorKeyFile>
<Nullable>enable</Nullable>
Expand Down
12 changes: 6 additions & 6 deletions GoToBible.Engine/Renderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ public async Task<RenderedPassage> RenderAsync(RenderingParameters parameters, b
for (int i = 0; i < lines1.Count; i++)
{
int expectedVerseNumber = i + 1;
if (int.TryParse(lines1[i].Substring(0, lines1[i].IndexOf(' ')), out int verseNumber) && verseNumber > expectedVerseNumber)
if (int.TryParse(lines1[i].AsSpan(0, lines1[i].IndexOf(' ')), out int verseNumber) && verseNumber > expectedVerseNumber)
{
lines1.Insert(i, $"{expectedVerseNumber} ");
}
Expand All @@ -218,7 +218,7 @@ public async Task<RenderedPassage> RenderAsync(RenderingParameters parameters, b
for (int i = 0; i < lines2.Count; i++)
{
int expectedVerseNumber = i + 1;
if (int.TryParse(lines2[i].Substring(0, lines2[i].IndexOf(' ')), out int verseNumber) && verseNumber > expectedVerseNumber)
if (int.TryParse(lines2[i].AsSpan(0, lines2[i].IndexOf(' ')), out int verseNumber) && verseNumber > expectedVerseNumber)
{
lines2.Insert(i, $"{expectedVerseNumber} ");
}
Expand All @@ -227,15 +227,15 @@ public async Task<RenderedPassage> RenderAsync(RenderingParameters parameters, b
// Add a superscription, if missing
if (lines1.Count > lines2.Count
&& lines2.Count > 0
&& int.TryParse(lines2[0].Substring(0, lines2[0].IndexOf(' ')), out int _)
&& !int.TryParse(lines1[0].Substring(0, lines1[0].IndexOf(' ')), out int _))
&& int.TryParse(lines2[0].AsSpan(0, lines2[0].IndexOf(' ')), out int _)
&& !int.TryParse(lines1[0].AsSpan(0, lines1[0].IndexOf(' ')), out int _))
{
lines2.Insert(0, string.Empty);
}
else if (lines2.Count > lines1.Count
&& lines1.Count > 0
&& int.TryParse(lines1[0].Substring(0, lines1[0].IndexOf(' ')), out int _)
&& !int.TryParse(lines2[0].Substring(0, lines2[0].IndexOf(' ')), out int _))
&& int.TryParse(lines1[0].AsSpan(0, lines1[0].IndexOf(' ')), out int _)
&& !int.TryParse(lines2[0].AsSpan(0, lines2[0].IndexOf(' ')), out int _))
{
lines1.Insert(0, string.Empty);
}
Expand Down
2 changes: 1 addition & 1 deletion GoToBible.Model/ChapterReference.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public ChapterReference(string bookAndChapter)
{
this.Book = bookAndChapter[..lastSpaceIndex];
string chapter = bookAndChapter[(lastSpaceIndex + 1)..];
if (chapter.Contains(":", StringComparison.OrdinalIgnoreCase))
if (chapter.Contains(':'))
{
chapter = chapter[..chapter.IndexOf(":", StringComparison.OrdinalIgnoreCase)];
}
Expand Down
4 changes: 2 additions & 2 deletions GoToBible.Model/ExtensionMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ public static PassageReference AsPassageReference(this string passage, int defau
sb.Append('-');
continue;
}
else if (displayRange.Contains(":", StringComparison.OrdinalIgnoreCase))
else if (displayRange.Contains(':'))
{
string[] displayRangeParts = displayRange.Split(":", StringSplitOptions.RemoveEmptyEntries);
if (int.TryParse(displayRangeParts.First(), out int displayRangeChapter) && displayRangeChapter == chapter)
Expand Down Expand Up @@ -657,7 +657,7 @@ internal static string NormaliseCommas(this string rangePart)
internal static string NormaliseSingleChapterReference(this string passage)
{
string[] semiParts = passage.Split(';');
if (!semiParts[0].Contains(":"))
if (!semiParts[0].Contains(':'))
{
Regex numberStartRegex = new Regex(@"[\w\s]\d", RegexOptions.Compiled);
int numberStart = numberStartRegex.Match(semiParts[0]).Index + 1;
Expand Down
8 changes: 4 additions & 4 deletions GoToBible.Model/GoToBible.Model.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>GoToBible.Model.snk</AssemblyOriginatorKeyFile>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
Expand All @@ -27,16 +27,16 @@
<ApplicationIcon>App.ico</ApplicationIcon>
<PackageLicenseExpression>LGPL-3.0-or-later</PackageLicenseExpression>
<RepositoryType>git</RepositoryType>
<PackageReleaseNotes>Bug fixes for one chapter books</PackageReleaseNotes>
<Version>1.1.8</Version>
<PackageReleaseNotes>.NET 6.0 support</PackageReleaseNotes>
<Version>1.1.9</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>bin\GoToBible.Model.xml</DocumentationFile>
</PropertyGroup>

<ItemGroup>
<None Include="..\README.md" Pack="true" PackagePath="\"/>
<None Include="..\README.md" Pack="true" PackagePath="\" />
<None Include="App.png">
<Pack>True</Pack>
<PackagePath></PackagePath>
Expand Down
8 changes: 4 additions & 4 deletions GoToBible.Providers/GoToBible.Providers.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>GoToBible.Providers.snk</AssemblyOriginatorKeyFile>
<Nullable>enable</Nullable>
Expand Down Expand Up @@ -46,9 +46,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="HtmlAgilityPack" Version="1.11.37" />
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="5.0.0" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.38" />
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="6.0.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.354">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
4 changes: 3 additions & 1 deletion GoToBible.Tests.Model/GoToBible.Tests.Model.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>

<IsPackable>false</IsPackable>

Expand All @@ -10,6 +10,8 @@
<AssemblyOriginatorKeyFile>GoToBible.Tests.Model.snk</AssemblyOriginatorKeyFile>

<EnforceCodeStyleInBuild>false</EnforceCodeStyleInBuild>

<OutputType>Library</OutputType>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand Down
8 changes: 4 additions & 4 deletions GoToBible.Web/Client/GoToBible.Web.Client.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<Nullable>enable</Nullable>
<SignAssembly>true</SignAssembly>
Expand Down Expand Up @@ -29,13 +29,13 @@

<ItemGroup>
<PackageReference Include="Blazored.LocalStorage" Version="4.1.5" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="5.0.11" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="5.0.11" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="6.0.0" PrivateAssets="all" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.354">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Net.Http.Json" Version="5.0.0" />
<PackageReference Include="System.Net.Http.Json" Version="6.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
7 changes: 6 additions & 1 deletion GoToBible.Web/Server/Controllers/RenderPassageController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,12 @@ public async Task<IActionResult> Post(RenderingParameters parameters, bool rende
// Log the URL, with details to help us debug
RequestHeaders header = this.Request.GetTypedHeaders();
string renderingParameters = JsonSerializer.Serialize(parameters);
this.logger.LogError(ex, $"URL: {this.Request.GetDisplayUrl()}{Environment.NewLine}Referer: {header.Referer}{Environment.NewLine}RenderingParameters: {renderingParameters}");
this.logger.LogError(
ex,
"URL: {DisplayUrl}\r\nReferer: {Referer}\r\nRenderingParameters: {RenderingParameters}",
this.Request.GetDisplayUrl(),
header.Referer,
renderingParameters);
return this.Problem();
}
}
Expand Down
12 changes: 6 additions & 6 deletions GoToBible.Web/Server/GoToBible.Web.Server.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<StartupObject>GoToBible.Web.Server.Program</StartupObject>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<SignAssembly>true</SignAssembly>
Expand All @@ -23,11 +23,11 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="5.0.11" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.11" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.11" />
<PackageReference Include="Microsoft.Extensions.Caching.SqlServer" Version="5.0.1" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="5.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="6.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Caching.SqlServer" Version="6.0.0" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="6.0.0" />
<PackageReference Include="Pomelo.Extensions.Caching.MySql" Version="2.1.2" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.354">
<PrivateAssets>all</PrivateAssets>
Expand Down
2 changes: 1 addition & 1 deletion GoToBible.Web/Server/Pages/Error.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public ErrorModel(ILogger<ErrorModel> logger)
public void OnGet()
{
this.RequestId = Activity.Current?.Id ?? this.HttpContext.TraceIdentifier;
this.logger.LogError($"Error in Request #{this.RequestId}");
this.logger.LogError("Error in Request #{RequestId}", this.RequestId);
}
}
}
89 changes: 0 additions & 89 deletions GoToBible.Windows.Designer/GoToBible.Windows.Designer.csproj

This file was deleted.

41 changes: 0 additions & 41 deletions GoToBible.Windows.Designer/Properties/AssemblyInfo.cs

This file was deleted.

Loading

0 comments on commit adb39b3

Please sign in to comment.