-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Add support for RouteHandlerInvocationContext<> overloads #41406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
07033c9
033bc58
93a6726
5dd971f
5ce83fc
d87d6a7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,6 +30,26 @@ Microsoft.AspNetCore.Http.HttpResponse</Description> | |
|
|
||
| <ItemGroup> | ||
| <InternalsVisibleTo Include="Microsoft.AspNetCore.Http.Abstractions.Microbenchmarks" /> | ||
| <InternalsVisibleTo Include="Microsoft.AspNetCore.Http.Extensions" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <None Update="RouteHandlerInvocationContextOfT.tt"> | ||
| <Generator>TextTemplatingFileGenerator</Generator> | ||
| <LastGenOutput>RouteHandlerInvocationContextOfT.cs</LastGenOutput> | ||
| </None> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if we can include this in the global directory.props cc @dougbu
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You mean notice a project contains a .tt file and add the We only have 3 projects containing this
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not an issue, I would just like to clean it up as we plan to code generate more things.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's up to you @davidfowl whether to centralize things in this PR. I recommend testing if the code in our root Directory.Build.props prevents VS rewriting the project to list the The specific approach would be something like |
||
| <Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <Compile Update="RouteHandlerInvocationContextOfT.cs"> | ||
| <DesignTime>True</DesignTime> | ||
| <AutoGen>True</AutoGen> | ||
| <DependentUpon>RouteHandlerInvocationContextOfT.tt</DependentUpon> | ||
| </Compile> | ||
| </ItemGroup> | ||
|
|
||
| </Project> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| namespace Microsoft.AspNetCore.Http; | ||
|
|
||
| /// <summary> | ||
| /// Provides an abstraction for wrapping the <see cref="HttpContext"/> and arguments | ||
| /// provided to a route handler. | ||
| /// </summary> | ||
| public abstract class RouteHandlerInvocationContextBase | ||
captainsafia marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| { | ||
| /// <summary> | ||
| /// The <see cref="HttpContext"/> associated with the current request being processed by the filter. | ||
| /// </summary> | ||
| public abstract HttpContext HttpContext { get; } | ||
|
|
||
| /// <summary> | ||
| /// A list of arguments provided in the current request to the filter. | ||
| /// <remarks> | ||
| /// This list is not read-only to permit modifying of existing arguments by filters. | ||
| /// </remarks> | ||
| /// </summary> | ||
| public abstract IList<object?> Arguments { get; } | ||
|
|
||
| /// <summary> | ||
| /// Retrieve the argument given its position in the argument list. | ||
| /// </summary> | ||
| /// <typeparam name="T">The <see cref="Type"/> of the resolved argument.</typeparam> | ||
| /// <param name="index">An integer representing the position of the argument in the argument list.</param> | ||
| /// <returns>The argument at a given <paramref name="index"/></returns> | ||
| public abstract T GetArgument<T>(int index); | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.