Skip to content

Commit b7e739f

Browse files
davidfowlmartincostello
authored andcommitted
More changes
- Enable nullable and removed a null check - Validate auth options on startup
1 parent ce2f285 commit b7e739f

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

src/TodoApp/ApiModule.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public static IEndpointRouteBuilder MapTodoApiRoutes(this IEndpointRouteBuilder
5252
ITodoService service,
5353
CancellationToken cancellationToken) =>
5454
{
55-
if (model is null || string.IsNullOrWhiteSpace(model.Text))
55+
if (string.IsNullOrWhiteSpace(model.Text))
5656
{
5757
return Results.Problem("No item text specified.", statusCode: StatusCodes.Status400BadRequest);
5858
}

src/TodoApp/AuthenticationModule.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ public static IServiceCollection AddGitHubAuthentication(this IServiceCollection
5555
options.ClaimActions.MapJsonKey(GitHubAvatarClaim, "avatar_url");
5656
}
5757
})
58+
.ValidateOnStart()
5859
.Services;
5960
}
6061

src/TodoApp/TodoApp.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
77
<TypeScriptToolsVersion>latest</TypeScriptToolsVersion>
88
<UserSecretsId>TodoApp</UserSecretsId>
9+
<Nullable>enable</Nullable>
910
</PropertyGroup>
1011
<ItemGroup>
1112
<PackageReference Include="AspNet.Security.OAuth.GitHub" Version="6.0.0-preview.6.21378.61" />

0 commit comments

Comments
 (0)