Skip to content

Commit 3fa69c5

Browse files
committed
Update to .NET 5.0
1 parent cd5cc71 commit 3fa69c5

28 files changed

Lines changed: 111 additions & 90 deletions

‎.vscode/settings.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"editor.detectIndentation": false,
33
"editor.insertSpaces": true,
44
"editor.tabSize": 2,
5+
"omnisharp.enableEditorConfigSupport": true,
56
"files.associations": {
67
"*.md": "mdx"
7-
},
8+
}
89
}

‎SpotifyAPI.Web.Auth/AuthException.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ namespace SpotifyAPI.Web.Auth
33
[System.Serializable]
44
public class AuthException : System.Exception
55
{
6-
public AuthException(string error, string state)
6+
public AuthException(string? error, string? state)
77
{
88
Error = error;
99
State = state;

‎SpotifyAPI.Web.Auth/EmbedIOAuthServer.cs‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,24 +35,25 @@ public EmbedIOAuthServer(Uri baseUri, int port, Assembly resourceAssembly, strin
3535
.WithModule(new ActionModule("/", HttpVerbs.Post, (ctx) =>
3636
{
3737
var query = ctx.Request.QueryString;
38-
if (query["error"] != null)
38+
var error = query["error"];
39+
if (error != null)
3940
{
40-
throw new AuthException(query["error"], query["state"]);
41+
throw new AuthException(error, query["state"]);
4142
}
4243

4344
var requestType = query.Get("request_type");
4445
if (requestType == "token")
4546
{
4647
ImplictGrantReceived?.Invoke(this, new ImplictGrantResponse(
47-
query["access_token"], query["token_type"], int.Parse(query["expires_in"])
48+
query["access_token"]!, query["token_type"]!, int.Parse(query["expires_in"]!)
4849
)
4950
{
5051
State = query["state"]
5152
});
5253
}
5354
if (requestType == "code")
5455
{
55-
AuthorizationCodeReceived?.Invoke(this, new AuthorizationCodeResponse(query["code"])
56+
AuthorizationCodeReceived?.Invoke(this, new AuthorizationCodeResponse(query["code"]!)
5657
{
5758
State = query["state"]
5859
});

‎SpotifyAPI.Web.Auth/Models/Response/AuthorizationCodeResponse.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ public AuthorizationCodeResponse(string code)
1010
}
1111

1212
public string Code { get; set; } = default!;
13-
public string State { get; set; } = default!;
13+
public string? State { get; set; } = default!;
1414
}
1515
}

‎SpotifyAPI.Web.Auth/Models/Response/ImplicitGrantResponse.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public ImplictGrantResponse(string accessToken, string tokenType, int expiresIn)
1717
public string AccessToken { get; set; } = default!;
1818
public string TokenType { get; set; } = default!;
1919
public int ExpiresIn { get; set; }
20-
public string State { get; set; } = default!;
20+
public string? State { get; set; } = default!;
2121

2222
/// <summary>
2323
/// Auto-Initalized to UTC Now

‎SpotifyAPI.Web.Auth/SpotifyAPI.Web.Auth.csproj‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>netstandard2.1;netstandard2.0</TargetFrameworks>
4-
<LangVersion>8.0</LangVersion>
3+
<TargetFrameworks>net5.0;netstandard2.1;netstandard2.0</TargetFrameworks>
4+
<LangVersion>9.0</LangVersion>
55
<Nullable>enable</Nullable>
66
<PackageId>SpotifyAPI.Web.Auth</PackageId>
77
<Title>SpotifyAPI.Web.Auth</Title>

‎SpotifyAPI.Web.Examples/Example.ASP/Example.ASP.csproj‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project Sdk="Microsoft.NET.Sdk.Web">
33
<PropertyGroup>
4-
<TargetFramework>netcoreapp3.1</TargetFramework>
4+
<TargetFramework>net5.0</TargetFramework>
55
<UserSecretsId>da29eac4-4c22-4a7f-b393-379e83b60998</UserSecretsId>
66
</PropertyGroup>
77
<ItemGroup>
Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
2-
<Router AppAssembly="@typeof(Program).Assembly">
3-
<Found Context="routeData">
4-
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
5-
</Found>
6-
<NotFound>
7-
<LayoutView Layout="@typeof(MainLayout)">
8-
<p>Sorry, there's nothing at this address.</p>
9-
</LayoutView>
10-
</NotFound>
1+
<Router AppAssembly="@typeof(Program).Assembly">
2+
<Found Context="routeData">
3+
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
4+
</Found>
5+
<NotFound>
6+
<LayoutView Layout="@typeof(MainLayout)">
7+
<p>Sorry, there's nothing at this address.</p>
8+
</LayoutView>
9+
</NotFound>
1110
</Router>

‎SpotifyAPI.Web.Examples/Example.ASPBlazor/Example.ASPBlazor.csproj‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp3.1</TargetFramework>
4+
<TargetFramework>net5.0</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<Router AppAssembly="@typeof(Program).Assembly">
2-
<Found Context="routeData">
3-
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
4-
</Found>
5-
<NotFound>
6-
<LayoutView Layout="@typeof(MainLayout)">
7-
<p>Sorry, there's nothing at this address.</p>
8-
</LayoutView>
9-
</NotFound>
2+
<Found Context="routeData">
3+
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
4+
</Found>
5+
<NotFound>
6+
<LayoutView Layout="@typeof(MainLayout)">
7+
<p>Sorry, there's nothing at this address.</p>
8+
</LayoutView>
9+
</NotFound>
1010
</Router>

0 commit comments

Comments
 (0)