Skip to content

Conversation

davidfowl
Copy link
Contributor

  • Close over WebApplicationBuilder for configuration and environment.
  • Male explicit call to UseRouting so the error handler works
  • Grouped middleware Use* before route Map*.

- Close over WebApplicationBuilder for configuration and environment.
- Male explicit call to UseRouting so the error handler works
- Grouped middleware Use* before route Map*.
- Enable nullable and removed a null check
- Validate auth options on startup
@codecov
Copy link

codecov bot commented Aug 8, 2021

Codecov Report

Merging #71 (4f047bc) into main (50c687a) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #71      +/-   ##
==========================================
+ Coverage   94.95%   94.96%   +0.01%     
==========================================
  Files          17       17              
  Lines         317      318       +1     
==========================================
+ Hits          301      302       +1     
  Misses         16       16              
Impacted Files Coverage Δ
src/TodoApp/ApiModule.cs 100.00% <100.00%> (ø)
src/TodoApp/AuthenticationModule.cs 100.00% <100.00%> (ø)
src/TodoApp/Program.cs 86.04% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2886a65...4f047bc. Read the comment docs.

});

// Add user authentication with GitHub as an external OAuth provider
builder.Services.AddGitHubAuthentication();

// Add Razor Pages to render the UI
builder.Services.AddRazorPages();
builder.Services.AddRouting();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah did I mix up which one is implicit?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep this is implicit

@@ -55,6 +55,7 @@ public static IServiceCollection AddGitHubAuthentication(this IServiceCollection
options.ClaimActions.MapJsonKey(GitHubAvatarClaim, "avatar_url");
}
})
.ValidateOnStart()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice.

@martincostello martincostello added the enhancement New feature or request label Aug 8, 2021
@martincostello martincostello enabled auto-merge (rebase) August 8, 2021 08:14
@martincostello
Copy link
Owner

Thanks!

@@ -52,7 +52,7 @@ public static IEndpointRouteBuilder MapTodoApiRoutes(this IEndpointRouteBuilder
ITodoService service,
CancellationToken cancellationToken) =>
{
if (model is null || string.IsNullOrWhiteSpace(model.Text))
if (string.IsNullOrWhiteSpace(model.Text))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is new in rc1, we use the nullability of the parameter to determine if we should call your method with null. dotnet/aspnetcore#32375

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lots of nice little QoL and usability stuff coming in now 😎

@martincostello martincostello merged commit 5b09f54 into martincostello:main Aug 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants