Skip to content

Commit

Permalink
Downgrade to .NET Standard 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hez2010 committed Nov 26, 2019
1 parent a1a9b48 commit 2408dd1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions BlazorRouter/BlazorRouter.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>8.0</LangVersion>
<IsPackable>true</IsPackable>
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
Expand All @@ -10,11 +11,11 @@
<Copyright>hez2010</Copyright>
<PackageProjectUrl>https://github.com/hez2010/BlazorRouter</PackageProjectUrl>
<RepositoryUrl>https://github.com/hez2010/BlazorRouter</RepositoryUrl>
<PackageReleaseNotes>Support ASP.NET Core 3.0</PackageReleaseNotes>
<PackageReleaseNotes>Downgrade to .NET Standard 2.0 for better compatibility</PackageReleaseNotes>
<PackageId>Hez2010.BlazorRouter</PackageId>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<Product>BlazorRouter</Product>
<Version>1.1.0</Version>
<Version>1.1.1</Version>
<PackageRequireLicenseAcceptance>False</PackageRequireLicenseAcceptance>
<Company>hez2010</Company>
</PropertyGroup>
Expand Down
6 changes: 3 additions & 3 deletions BlazorRouter/TemplateParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ internal static RouteTemplate ParseTemplate(string template)

if (segment[0] != '{')
{
if (segment[^1] == '}')
if (segment[segment.Length - 1] == '}')
{
throw new InvalidOperationException(
$"Invalid template '{template}'. Missing '{{' in parameter segment '{segment}'.");
Expand All @@ -60,7 +60,7 @@ internal static RouteTemplate ParseTemplate(string template)
}
else
{
if (segment[^1] != '}')
if (segment[segment.Length - 1] != '}')
{
throw new InvalidOperationException(
$"Invalid template '{template}'. Missing '}}' in parameter segment '{segment}'.");
Expand All @@ -79,7 +79,7 @@ internal static RouteTemplate ParseTemplate(string template)
$"Invalid template '{template}'. The character '{segment[invalidCharacter]}' in parameter segment '{segment}' is not allowed.");
}

templateSegments[i] = new TemplateSegment(originalTemplate, segment[1..^1], isParameter: true);
templateSegments[i] = new TemplateSegment(originalTemplate, segment.Substring(1, segment.Length - 2), isParameter: true);
}
}

Expand Down

0 comments on commit 2408dd1

Please sign in to comment.