Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 7 additions & 26 deletions src/Http/Http.Abstractions/src/EndpointFilterFactoryContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,15 @@ namespace Microsoft.AspNetCore.Http;
public sealed class EndpointFilterFactoryContext
{
/// <summary>
/// Creates a new instance of the <see cref="EndpointFilterFactoryContext"/>.
/// The <see cref="MethodInfo"/> associated with the current route handler, <see cref="RequestDelegate"/> or MVC action.
/// </summary>
/// <param name="methodInfo">The <see cref="MethodInfo"/> associated with the route handler of the current request.</param>
/// <param name="endpointMetadata">The <see cref="EndpointBuilder.Metadata"/> associated with the endpoint the filter is targeting.</param>
/// <param name="applicationServices">The <see cref="IServiceProvider"/> instance used to access the application services.</param>
public EndpointFilterFactoryContext(MethodInfo methodInfo, IList<object> endpointMetadata, IServiceProvider applicationServices)
{
ArgumentNullException.ThrowIfNull(methodInfo);
ArgumentNullException.ThrowIfNull(endpointMetadata);
ArgumentNullException.ThrowIfNull(applicationServices);

MethodInfo = methodInfo;
EndpointMetadata = endpointMetadata;
ApplicationServices = applicationServices;
}

/// <summary>
/// The <see cref="MethodInfo"/> associated with the current route handler.
/// </summary>
public MethodInfo MethodInfo { get; }

/// <summary>
/// The <see cref="EndpointMetadataCollection"/> associated with the current endpoint.
/// </summary>
public IList<object> EndpointMetadata { get; }
/// <remarks>
/// In the future this could support more endpoint types.
/// </remarks>
public required MethodInfo MethodInfo { get; init; }

/// <summary>
/// Gets the <see cref="IServiceProvider"/> instance used to access application services.
/// The <see cref="EndpointBuilder"/> associated with the current endpoint being filtered.
/// </summary>
public IServiceProvider ApplicationServices { get; }
public required EndpointBuilder EndpointBuilder { get; init; }
}
7 changes: 4 additions & 3 deletions src/Http/Http.Abstractions/src/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ Microsoft.AspNetCore.Http.DefaultEndpointFilterInvocationContext
Microsoft.AspNetCore.Http.DefaultEndpointFilterInvocationContext.DefaultEndpointFilterInvocationContext(Microsoft.AspNetCore.Http.HttpContext! httpContext, params object![]! arguments) -> void
Microsoft.AspNetCore.Http.EndpointFilterDelegate
Microsoft.AspNetCore.Http.EndpointFilterFactoryContext
Microsoft.AspNetCore.Http.EndpointFilterFactoryContext.ApplicationServices.get -> System.IServiceProvider!
Microsoft.AspNetCore.Http.EndpointFilterFactoryContext.EndpointFilterFactoryContext(System.Reflection.MethodInfo! methodInfo, System.Collections.Generic.IList<object!>! endpointMetadata, System.IServiceProvider! applicationServices) -> void
Microsoft.AspNetCore.Http.EndpointFilterFactoryContext.EndpointMetadata.get -> System.Collections.Generic.IList<object!>!
Microsoft.AspNetCore.Http.EndpointFilterFactoryContext.EndpointBuilder.get -> Microsoft.AspNetCore.Builder.EndpointBuilder!
Microsoft.AspNetCore.Http.EndpointFilterFactoryContext.EndpointBuilder.init -> void
Microsoft.AspNetCore.Http.EndpointFilterFactoryContext.EndpointFilterFactoryContext() -> void
Microsoft.AspNetCore.Http.EndpointFilterFactoryContext.MethodInfo.get -> System.Reflection.MethodInfo!
Microsoft.AspNetCore.Http.EndpointFilterFactoryContext.MethodInfo.init -> void
Microsoft.AspNetCore.Http.EndpointFilterInvocationContext
Microsoft.AspNetCore.Http.EndpointFilterInvocationContext.EndpointFilterInvocationContext() -> void
Microsoft.AspNetCore.Http.EndpointMetadataCollection.Enumerator.Current.get -> object!
Expand Down
6 changes: 2 additions & 4 deletions src/Http/Http.Extensions/src/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ Microsoft.AspNetCore.Http.ProblemDetailsOptions.ProblemDetailsOptions() -> void
*REMOVED*Microsoft.AspNetCore.Mvc.ProblemDetails.Title.set -> void
*REMOVED*Microsoft.AspNetCore.Mvc.ProblemDetails.Type.get -> string?
*REMOVED*Microsoft.AspNetCore.Mvc.ProblemDetails.Type.set -> void
Microsoft.AspNetCore.Http.RequestDelegateFactoryOptions.EndpointBuilder.get -> Microsoft.AspNetCore.Builder.EndpointBuilder?
Microsoft.AspNetCore.Http.RequestDelegateFactoryOptions.EndpointBuilder.init -> void
Microsoft.AspNetCore.Mvc.ProblemDetails (forwarded, contained in Microsoft.AspNetCore.Http.Abstractions)
Microsoft.AspNetCore.Mvc.ProblemDetails.Detail.get -> string? (forwarded, contained in Microsoft.AspNetCore.Http.Abstractions)
Microsoft.AspNetCore.Mvc.ProblemDetails.Detail.set -> void (forwarded, contained in Microsoft.AspNetCore.Http.Abstractions)
Expand All @@ -52,10 +54,6 @@ Microsoft.AspNetCore.Mvc.ProblemDetails.Title.set -> void (forwarded, contained
Microsoft.AspNetCore.Mvc.ProblemDetails.Type.get -> string? (forwarded, contained in Microsoft.AspNetCore.Http.Abstractions)
Microsoft.AspNetCore.Mvc.ProblemDetails.Type.set -> void (forwarded, contained in Microsoft.AspNetCore.Http.Abstractions)
Microsoft.Extensions.DependencyInjection.ProblemDetailsServiceCollectionExtensions
Microsoft.AspNetCore.Http.RequestDelegateFactoryOptions.EndpointFilterFactories.get -> System.Collections.Generic.IReadOnlyList<System.Func<Microsoft.AspNetCore.Http.EndpointFilterFactoryContext!, Microsoft.AspNetCore.Http.EndpointFilterDelegate!, Microsoft.AspNetCore.Http.EndpointFilterDelegate!>!>?
Microsoft.AspNetCore.Http.RequestDelegateFactoryOptions.EndpointFilterFactories.init -> void
Microsoft.AspNetCore.Http.RequestDelegateFactoryOptions.EndpointMetadata.get -> System.Collections.Generic.IList<object!>?
Microsoft.AspNetCore.Http.RequestDelegateFactoryOptions.EndpointMetadata.init -> void
Microsoft.Extensions.DependencyInjection.HttpJsonServiceExtensions
static Microsoft.AspNetCore.Http.HttpRequestJsonExtensions.ReadFromJsonAsync(this Microsoft.AspNetCore.Http.HttpRequest! request, System.Type! type, System.Text.Json.Serialization.JsonSerializerContext! context, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask<object?>
static Microsoft.AspNetCore.Http.HttpRequestJsonExtensions.ReadFromJsonAsync<TValue>(this Microsoft.AspNetCore.Http.HttpRequest! request, System.Text.Json.Serialization.Metadata.JsonTypeInfo<TValue>! jsonTypeInfo, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask<TValue?>
Expand Down
Loading