-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[release/7.0] Add and use RDF.InferMetadata and update new PopulateMetadata API #43543
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
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
f06a315
Expose entire EndpointBuilder to filter factories
halter73 db9e629
Apply suggestions from code review
halter73 94a973c
Remove redundant if/else
halter73 fd65baf
Fix ArgumentException
halter73 70911bf
Add and use RDF.InferMetadata
halter73 3affb3a
Update PopulateMetadata API
halter73 d6ae282
Delete redundant file
halter73 365cc24
Suppress trimmer warnings
halter73 084eb7e
Add tests back
halter73 0e56b6c
Apply suggestions from code review
halter73 019d32d
Address more PR feedback
halter73 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/Http/Http.Abstractions/src/Metadata/IEndpointMetadataProvider.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| using System.Reflection; | ||
| using Microsoft.AspNetCore.Builder; | ||
|
|
||
| namespace Microsoft.AspNetCore.Http.Metadata; | ||
|
|
||
| /// <summary> | ||
| /// Indicates that a type provides a static method that provides <see cref="Endpoint"/> metadata when declared as a parameter type or the | ||
| /// returned type of an <see cref="Endpoint"/> route handler delegate. | ||
| /// </summary> | ||
| public interface IEndpointMetadataProvider | ||
| { | ||
| /// <summary> | ||
| /// Populates metadata for the related <see cref="Endpoint"/> and <see cref="MethodInfo"/>. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// This method is called by RequestDelegateFactory when creating a <see cref="RequestDelegate"/> and by MVC when creating endpoints for controller actions. | ||
| /// This is called for each parameter and return type of the route handler or action with a declared type implementing this interface. | ||
| /// Add or remove objects on the <see cref="EndpointBuilder.Metadata"/> property of the <paramref name="builder"/> to modify the <see cref="Endpoint.Metadata"/> being built. | ||
| /// </remarks> | ||
| /// <param name="method">The <see cref="MethodInfo"/> of the route handler delegate or MVC Action of the endpoint being created.</param> | ||
| /// <param name="builder">The <see cref="EndpointBuilder"/> used to construct the endpoint for the given <paramref name="method"/>.</param> | ||
| static abstract void PopulateMetadata(MethodInfo method, EndpointBuilder builder); | ||
| } |
26 changes: 26 additions & 0 deletions
26
src/Http/Http.Abstractions/src/Metadata/IEndpointParameterMetadataProvider.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| using System.Reflection; | ||
| using Microsoft.AspNetCore.Builder; | ||
|
|
||
| namespace Microsoft.AspNetCore.Http.Metadata; | ||
|
|
||
| /// <summary> | ||
| /// Indicates that a type provides a static method that provides <see cref="Endpoint"/> metadata when declared as the | ||
| /// parameter type of an <see cref="Endpoint"/> route handler delegate. | ||
| /// </summary> | ||
| public interface IEndpointParameterMetadataProvider | ||
| { | ||
| /// <summary> | ||
| /// Populates metadata for the related <see cref="Endpoint"/> and <see cref="ParameterInfo"/>. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// This method is called by RequestDelegateFactory when creating a <see cref="RequestDelegate"/> and by MVC when creating endpoints for controller actions. | ||
| /// This is called for each parameter of the route handler or action with a declared type implementing this interface. | ||
| /// Add or remove objects on the <see cref="EndpointBuilder.Metadata"/> property of the <paramref name="builder"/> to modify the <see cref="Endpoint.Metadata"/> being built. | ||
| /// </remarks> | ||
| /// <param name="parameter">The <see cref="ParameterInfo"/> of the route handler delegate or MVC Action of the endpoint being created.</param> | ||
| /// <param name="builder">The <see cref="EndpointBuilder"/> used to construct the endpoint for the given <paramref name="parameter"/>.</param> | ||
| static abstract void PopulateMetadata(ParameterInfo parameter, EndpointBuilder builder); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
44 changes: 0 additions & 44 deletions
44
src/Http/Http.Extensions/src/EndpointParameterMetadataContext.cs
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
23 changes: 0 additions & 23 deletions
23
src/Http/Http.Extensions/src/IEndpointParameterMetadataProvider.cs
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.