From 37ec3c5c2c958505ebe42af8dd16ed1a87780d5f Mon Sep 17 00:00:00 2001 From: Safia Abdalla Date: Tue, 10 Jan 2023 10:24:02 -0800 Subject: [PATCH] Make generated code classes file private --- .../gen/RequestDelegateGenerator.cs | 4 +- .../gen/RequestDelegateGeneratorSources.cs | 425 +++++++++--------- .../StaticRouteHandlerModel.Emitter.cs | 2 +- 3 files changed, 221 insertions(+), 210 deletions(-) diff --git a/src/Http/Http.Extensions/gen/RequestDelegateGenerator.cs b/src/Http/Http.Extensions/gen/RequestDelegateGenerator.cs index 6aed91ce80b5..2b3c14d62cdc 100644 --- a/src/Http/Http.Extensions/gen/RequestDelegateGenerator.cs +++ b/src/Http/Http.Extensions/gen/RequestDelegateGenerator.cs @@ -58,7 +58,7 @@ public void Initialize(IncrementalGeneratorInitializationContext context) if (builder.FilterFactories.Count > 0) { - filteredInvocation = BuildFilterDelegate(ic => + filteredInvocation = GeneratedRouteBuilderExtensionsCore.BuildFilterDelegate(ic => { if (ic.HttpContext.Response.StatusCode == 400) { @@ -86,7 +86,7 @@ public void Initialize(IncrementalGeneratorInitializationContext context) [System.Runtime.CompilerServices.CallerFilePath] string filePath = "", [System.Runtime.CompilerServices.CallerLineNumber]int lineNumber = 0) { - return MapCore(endpoints, pattern, handler, GetVerb, filePath, lineNumber); + return GeneratedRouteBuilderExtensionsCore.MapCore(endpoints, pattern, handler, GetVerb, filePath, lineNumber); } """); diff --git a/src/Http/Http.Extensions/gen/RequestDelegateGeneratorSources.cs b/src/Http/Http.Extensions/gen/RequestDelegateGeneratorSources.cs index a92584bfbe68..800e4c21e761 100644 --- a/src/Http/Http.Extensions/gen/RequestDelegateGeneratorSources.cs +++ b/src/Http/Http.Extensions/gen/RequestDelegateGeneratorSources.cs @@ -56,7 +56,12 @@ public SourceKey(string path, int line) } {{GeneratedCodeAttribute}} -internal static class GeneratedRouteBuilderExtensions +// This class needs to be internal so that the compiled application +// has access to the strongly-typed endpoint definitions that are +// generated by the compiler so that they will be favored by +// overload resolution and opt the runtime in to the code generated +// implementation produced here. +internal static class GenerateRouteBuilderEndpoints { private static readonly string[] GetVerb = new[] { HttpMethods.Get }; private static readonly string[] PostVerb = new[] { HttpMethods.Post }; @@ -64,7 +69,13 @@ internal static class GeneratedRouteBuilderExtensions private static readonly string[] DeleteVerb = new[] { HttpMethods.Delete }; private static readonly string[] PatchVerb = new[] { HttpMethods.Patch }; - private static class GenericThunks + {{endpoints}} +} + +{{GeneratedCodeAttribute}} +file static class GeneratedRouteBuilderExtensionsCore +{ + internal static class GenericThunks { public static readonly global::System.Collections.Generic.Dictionary<(string, int), (MetadataPopulator, RequestDelegateFactoryFunc)> map = new() { @@ -72,14 +83,12 @@ private static class GenericThunks }; } - private static readonly global::System.Collections.Generic.Dictionary<(string, int), (MetadataPopulator, RequestDelegateFactoryFunc)> map = new() + internal static readonly global::System.Collections.Generic.Dictionary<(string, int), (MetadataPopulator, RequestDelegateFactoryFunc)> map = new() { {{thunks}} }; - {{endpoints}} - - private static global::Microsoft.AspNetCore.Builder.RouteHandlerBuilder MapCore( + internal static global::Microsoft.AspNetCore.Builder.RouteHandlerBuilder MapCore( this global::Microsoft.AspNetCore.Routing.IEndpointRouteBuilder routes, string pattern, System.Delegate handler, @@ -91,7 +100,7 @@ private static class GenericThunks return GetOrAddRouteEndpointDataSource(routes).AddRouteHandler(RoutePatternFactory.Parse(pattern), handler, httpMethods, isFallback: false, populate, factory); } - private static global::Microsoft.AspNetCore.Builder.RouteHandlerBuilder MapCore( + internal static global::Microsoft.AspNetCore.Builder.RouteHandlerBuilder MapCore( this global::Microsoft.AspNetCore.Routing.IEndpointRouteBuilder routes, string pattern, System.Delegate handler, @@ -103,7 +112,7 @@ private static class GenericThunks return GetOrAddRouteEndpointDataSource(routes).AddRouteHandler(RoutePatternFactory.Parse(pattern), handler, httpMethods, isFallback: false, populate, factory); } - private static SourceGeneratedRouteEndpointDataSource GetOrAddRouteEndpointDataSource(IEndpointRouteBuilder endpoints) + internal static SourceGeneratedRouteEndpointDataSource GetOrAddRouteEndpointDataSource(IEndpointRouteBuilder endpoints) { SourceGeneratedRouteEndpointDataSource? routeEndpointDataSource = null; foreach (var dataSource in endpoints.DataSources) @@ -122,7 +131,7 @@ private static SourceGeneratedRouteEndpointDataSource GetOrAddRouteEndpointDataS return routeEndpointDataSource; } - private static EndpointFilterDelegate BuildFilterDelegate(EndpointFilterDelegate filteredInvocation, EndpointBuilder builder, global::System.Reflection.MethodInfo mi) + internal static EndpointFilterDelegate BuildFilterDelegate(EndpointFilterDelegate filteredInvocation, EndpointBuilder builder, global::System.Reflection.MethodInfo mi) { var routeHandlerFilters = builder.FilterFactories; var context0 = new EndpointFilterFactoryContext @@ -139,17 +148,17 @@ private static EndpointFilterDelegate BuildFilterDelegate(EndpointFilterDelegate return filteredInvocation; } - private static void PopulateMetadata(System.Reflection.MethodInfo method, EndpointBuilder builder) where T : Microsoft.AspNetCore.Http.Metadata.IEndpointMetadataProvider + internal static void PopulateMetadata(System.Reflection.MethodInfo method, EndpointBuilder builder) where T : Microsoft.AspNetCore.Http.Metadata.IEndpointMetadataProvider { T.PopulateMetadata(method, builder); } - private static void PopulateMetadata(System.Reflection.ParameterInfo parameter, EndpointBuilder builder) where T : Microsoft.AspNetCore.Http.Metadata.IEndpointParameterMetadataProvider + internal static void PopulateMetadata(System.Reflection.ParameterInfo parameter, EndpointBuilder builder) where T : Microsoft.AspNetCore.Http.Metadata.IEndpointParameterMetadataProvider { T.PopulateMetadata(parameter, builder); } - private static Task ExecuteObjectResult(object? obj, HttpContext httpContext) + internal static Task ExecuteObjectResult(object? obj, HttpContext httpContext) { if (obj is IResult r) { @@ -164,237 +173,239 @@ private static Task ExecuteObjectResult(object? obj, HttpContext httpContext) return httpContext.Response.WriteAsJsonAsync(obj); } } +} - {{GeneratedCodeAttribute}} - private sealed class SourceGeneratedRouteEndpointDataSource : EndpointDataSource +{{GeneratedCodeAttribute}} +file class SourceGeneratedRouteEndpointDataSource : EndpointDataSource +{ + private readonly List _routeEntries = new(); + private readonly IServiceProvider _applicationServices; + + public SourceGeneratedRouteEndpointDataSource(IServiceProvider applicationServices) { - private readonly List _routeEntries = new(); - private readonly IServiceProvider _applicationServices; + _applicationServices = applicationServices; + } - public SourceGeneratedRouteEndpointDataSource(IServiceProvider applicationServices) - { - _applicationServices = applicationServices; - } + public RouteHandlerBuilder AddRouteHandler( + RoutePattern pattern, + Delegate routeHandler, + IEnumerable httpMethods, + bool isFallback, + MetadataPopulator metadataPopulator, + RequestDelegateFactoryFunc requestDelegateFactoryFunc) + { + var conventions = new ThrowOnAddAfterEndpointBuiltConventionCollection(); + var finallyConventions = new ThrowOnAddAfterEndpointBuiltConventionCollection(); + var routeAttributes = RouteAttributes.RouteHandler; - public RouteHandlerBuilder AddRouteHandler( - RoutePattern pattern, - Delegate routeHandler, - IEnumerable httpMethods, - bool isFallback, - MetadataPopulator metadataPopulator, - RequestDelegateFactoryFunc requestDelegateFactoryFunc) + if (isFallback) { - var conventions = new ThrowOnAddAfterEndpointBuiltConventionCollection(); - var finallyConventions = new ThrowOnAddAfterEndpointBuiltConventionCollection(); - var routeAttributes = RouteAttributes.RouteHandler; - - if (isFallback) - { - routeAttributes |= RouteAttributes.Fallback; - } - _routeEntries.Add(new() - { - RoutePattern = pattern, - RouteHandler = routeHandler, - HttpMethods = httpMethods, - RouteAttributes = routeAttributes, - Conventions = conventions, - FinallyConventions = finallyConventions, - RequestDelegateFactory = requestDelegateFactoryFunc, - MetadataPopulator = metadataPopulator, - }); - return new RouteHandlerBuilder(new[] { new ConventionBuilder(conventions, finallyConventions) }); + routeAttributes |= RouteAttributes.Fallback; } - - public override IReadOnlyList Endpoints + _routeEntries.Add(new() { - get - { - var endpoints = new RouteEndpoint[_routeEntries.Count]; - for (int i = 0; i < _routeEntries.Count; i++) - { - endpoints[i] = (RouteEndpoint)CreateRouteEndpointBuilder(_routeEntries[i]).Build(); - } - return endpoints; - } - } + RoutePattern = pattern, + RouteHandler = routeHandler, + HttpMethods = httpMethods, + RouteAttributes = routeAttributes, + Conventions = conventions, + FinallyConventions = finallyConventions, + RequestDelegateFactory = requestDelegateFactoryFunc, + MetadataPopulator = metadataPopulator, + }); + return new RouteHandlerBuilder(new[] { new ConventionBuilder(conventions, finallyConventions) }); + } - public override IReadOnlyList GetGroupedEndpoints(RouteGroupContext context) + public override IReadOnlyList Endpoints + { + get { var endpoints = new RouteEndpoint[_routeEntries.Count]; for (int i = 0; i < _routeEntries.Count; i++) { - endpoints[i] = (RouteEndpoint)CreateRouteEndpointBuilder(_routeEntries[i], context.Prefix, context.Conventions, context.FinallyConventions).Build(); + endpoints[i] = (RouteEndpoint)CreateRouteEndpointBuilder(_routeEntries[i]).Build(); } return endpoints; } + } - public override IChangeToken GetChangeToken() => NullChangeToken.Singleton; + public override IReadOnlyList GetGroupedEndpoints(RouteGroupContext context) + { + var endpoints = new RouteEndpoint[_routeEntries.Count]; + for (int i = 0; i < _routeEntries.Count; i++) + { + endpoints[i] = (RouteEndpoint)CreateRouteEndpointBuilder(_routeEntries[i], context.Prefix, context.Conventions, context.FinallyConventions).Build(); + } + return endpoints; + } - private RouteEndpointBuilder CreateRouteEndpointBuilder( - RouteEntry entry, RoutePattern? groupPrefix = null, IReadOnlyList>? groupConventions = null, IReadOnlyList>? groupFinallyConventions = null) + public override IChangeToken GetChangeToken() => NullChangeToken.Singleton; + + private RouteEndpointBuilder CreateRouteEndpointBuilder( + RouteEntry entry, RoutePattern? groupPrefix = null, IReadOnlyList>? groupConventions = null, IReadOnlyList>? groupFinallyConventions = null) + { + var pattern = RoutePatternFactory.Combine(groupPrefix, entry.RoutePattern); + var handler = entry.RouteHandler; + var isRouteHandler = (entry.RouteAttributes & RouteAttributes.RouteHandler) == RouteAttributes.RouteHandler; + var isFallback = (entry.RouteAttributes & RouteAttributes.Fallback) == RouteAttributes.Fallback; + var order = isFallback ? int.MaxValue : 0; + var displayName = pattern.RawText ?? pattern.ToString(); + if (entry.HttpMethods is not null) { - var pattern = RoutePatternFactory.Combine(groupPrefix, entry.RoutePattern); - var handler = entry.RouteHandler; - var isRouteHandler = (entry.RouteAttributes & RouteAttributes.RouteHandler) == RouteAttributes.RouteHandler; - var isFallback = (entry.RouteAttributes & RouteAttributes.Fallback) == RouteAttributes.Fallback; - var order = isFallback ? int.MaxValue : 0; - var displayName = pattern.RawText ?? pattern.ToString(); - if (entry.HttpMethods is not null) - { - // Prepends the HTTP method to the DisplayName produced with pattern + method name - displayName = $"HTTP: {string.Join("", "", entry.HttpMethods)} {displayName}"; - } - if (isFallback) - { - displayName = $"Fallback {displayName}"; - } - // If we're not a route handler, we started with a fully realized (although unfiltered) RequestDelegate, so we can just redirect to that - // while running any conventions. We'll put the original back if it remains unfiltered right before building the endpoint. - RequestDelegate? factoryCreatedRequestDelegate = null; - // Let existing conventions capture and call into builder.RequestDelegate as long as they do so after it has been created. - RequestDelegate redirectRequestDelegate = context => - { - if (factoryCreatedRequestDelegate is null) - { - throw new InvalidOperationException("Resources.RouteEndpointDataSource_RequestDelegateCannotBeCalledBeforeBuild"); - } - return factoryCreatedRequestDelegate(context); - }; - // Add MethodInfo and HttpMethodMetadata (if any) as first metadata items as they are intrinsic to the route much like - // the pattern or default display name. This gives visibility to conventions like WithOpenApi() to intrinsic route details - // (namely the MethodInfo) even when applied early as group conventions. - RouteEndpointBuilder builder = new(redirectRequestDelegate, pattern, order) - { - DisplayName = displayName, - ApplicationServices = _applicationServices, - }; - if (isRouteHandler) - { - builder.Metadata.Add(handler.Method); - } - if (entry.HttpMethods is not null) - { - builder.Metadata.Add(new HttpMethodMetadata(entry.HttpMethods)); - } - // Apply group conventions before entry-specific conventions added to the RouteHandlerBuilder. - if (groupConventions is not null) - { - foreach (var groupConvention in groupConventions) - { - groupConvention(builder); - } - } - // Any metadata inferred directly inferred by RDF or indirectly inferred via IEndpoint(Parameter)MetadataProviders are - // considered less specific than method-level attributes and conventions but more specific than group conventions - // so inferred metadata gets added in between these. If group conventions need to override inferred metadata, - // they can do so via IEndpointConventionBuilder.Finally like the do to override any other entry-specific metadata. - if (isRouteHandler) - { - entry.MetadataPopulator(entry.RouteHandler, builder); - } - // Add delegate attributes as metadata before entry-specific conventions but after group conventions. - var attributes = handler.Method.GetCustomAttributes(); - if (attributes is not null) - { - foreach (var attribute in attributes) - { - builder.Metadata.Add(attribute); - } - } - entry.Conventions.IsReadOnly = true; - foreach (var entrySpecificConvention in entry.Conventions) - { - entrySpecificConvention(builder); - } - // If no convention has modified builder.RequestDelegate, we can use the RequestDelegate returned by the RequestDelegateFactory directly. - var conventionOverriddenRequestDelegate = ReferenceEquals(builder.RequestDelegate, redirectRequestDelegate) ? null : builder.RequestDelegate; - if (isRouteHandler || builder.FilterFactories.Count > 0) + // Prepends the HTTP method to the DisplayName produced with pattern + method name + displayName = $"HTTP: {string.Join("", "", entry.HttpMethods)} {displayName}"; + } + if (isFallback) + { + displayName = $"Fallback {displayName}"; + } + // If we're not a route handler, we started with a fully realized (although unfiltered) RequestDelegate, so we can just redirect to that + // while running any conventions. We'll put the original back if it remains unfiltered right before building the endpoint. + RequestDelegate? factoryCreatedRequestDelegate = null; + // Let existing conventions capture and call into builder.RequestDelegate as long as they do so after it has been created. + RequestDelegate redirectRequestDelegate = context => + { + if (factoryCreatedRequestDelegate is null) { - factoryCreatedRequestDelegate = entry.RequestDelegateFactory(entry.RouteHandler, builder); + throw new InvalidOperationException("Resources.RouteEndpointDataSource_RequestDelegateCannotBeCalledBeforeBuild"); } - Debug.Assert(factoryCreatedRequestDelegate is not null); - // Use the overridden RequestDelegate if it exists. If the overridden RequestDelegate is merely wrapping the final RequestDelegate, - // it will still work because of the redirectRequestDelegate. - builder.RequestDelegate = conventionOverriddenRequestDelegate ?? factoryCreatedRequestDelegate; - entry.FinallyConventions.IsReadOnly = true; - foreach (var entryFinallyConvention in entry.FinallyConventions) + return factoryCreatedRequestDelegate(context); + }; + // Add MethodInfo and HttpMethodMetadata (if any) as first metadata items as they are intrinsic to the route much like + // the pattern or default display name. This gives visibility to conventions like WithOpenApi() to intrinsic route details + // (namely the MethodInfo) even when applied early as group conventions. + RouteEndpointBuilder builder = new(redirectRequestDelegate, pattern, order) + { + DisplayName = displayName, + ApplicationServices = _applicationServices, + }; + if (isRouteHandler) + { + builder.Metadata.Add(handler.Method); + } + if (entry.HttpMethods is not null) + { + builder.Metadata.Add(new HttpMethodMetadata(entry.HttpMethods)); + } + // Apply group conventions before entry-specific conventions added to the RouteHandlerBuilder. + if (groupConventions is not null) + { + foreach (var groupConvention in groupConventions) { - entryFinallyConvention(builder); + groupConvention(builder); } - if (groupFinallyConventions is not null) + } + // Any metadata inferred directly inferred by RDF or indirectly inferred via IEndpoint(Parameter)MetadataProviders are + // considered less specific than method-level attributes and conventions but more specific than group conventions + // so inferred metadata gets added in between these. If group conventions need to override inferred metadata, + // they can do so via IEndpointConventionBuilder.Finally like the do to override any other entry-specific metadata. + if (isRouteHandler) + { + entry.MetadataPopulator(entry.RouteHandler, builder); + } + // Add delegate attributes as metadata before entry-specific conventions but after group conventions. + var attributes = handler.Method.GetCustomAttributes(); + if (attributes is not null) + { + foreach (var attribute in attributes) { - // Group conventions are ordered by the RouteGroupBuilder before - // being provided here. - foreach (var groupFinallyConvention in groupFinallyConventions) - { - groupFinallyConvention(builder); - } + builder.Metadata.Add(attribute); } - return builder; } - - private readonly struct RouteEntry + entry.Conventions.IsReadOnly = true; + foreach (var entrySpecificConvention in entry.Conventions) { - public MetadataPopulator MetadataPopulator { get; init; } - public RequestDelegateFactoryFunc RequestDelegateFactory { get; init; } - public RoutePattern RoutePattern { get; init; } - public Delegate RouteHandler { get; init; } - public IEnumerable HttpMethods { get; init; } - public RouteAttributes RouteAttributes { get; init; } - public ThrowOnAddAfterEndpointBuiltConventionCollection Conventions { get; init; } - public ThrowOnAddAfterEndpointBuiltConventionCollection FinallyConventions { get; init; } + entrySpecificConvention(builder); } - - [Flags] - private enum RouteAttributes + // If no convention has modified builder.RequestDelegate, we can use the RequestDelegate returned by the RequestDelegateFactory directly. + var conventionOverriddenRequestDelegate = ReferenceEquals(builder.RequestDelegate, redirectRequestDelegate) ? null : builder.RequestDelegate; + if (isRouteHandler || builder.FilterFactories.Count > 0) { - // The endpoint was defined by a RequestDelegate, RequestDelegateFactory.Create() should be skipped unless there are endpoint filters. - None = 0, - // This was added as Delegate route handler, so RequestDelegateFactory.Create() should always be called. - RouteHandler = 1, - // This was added by MapFallback. - Fallback = 2, + factoryCreatedRequestDelegate = entry.RequestDelegateFactory(entry.RouteHandler, builder); } - - // This private class is only exposed to internal code via ICollection> in RouteEndpointBuilder where only Add is called. - private sealed class ThrowOnAddAfterEndpointBuiltConventionCollection : List>, ICollection> + Debug.Assert(factoryCreatedRequestDelegate is not null); + // Use the overridden RequestDelegate if it exists. If the overridden RequestDelegate is merely wrapping the final RequestDelegate, + // it will still work because of the redirectRequestDelegate. + builder.RequestDelegate = conventionOverriddenRequestDelegate ?? factoryCreatedRequestDelegate; + entry.FinallyConventions.IsReadOnly = true; + foreach (var entryFinallyConvention in entry.FinallyConventions) + { + entryFinallyConvention(builder); + } + if (groupFinallyConventions is not null) { - // We throw if someone tries to add conventions to the RouteEntry after endpoints have already been resolved meaning the conventions - // will not be observed given RouteEndpointDataSource is not meant to be dynamic and uses NullChangeToken.Singleton. - public bool IsReadOnly { get; set; } - void ICollection>.Add(Action convention) + // Group conventions are ordered by the RouteGroupBuilder before + // being provided here. + foreach (var groupFinallyConvention in groupFinallyConventions) { - if (IsReadOnly) - { - throw new InvalidOperationException("Resources.RouteEndpointDataSource_ConventionsCannotBeModifiedAfterBuild"); - } - Add(convention); + groupFinallyConvention(builder); } } + return builder; + } + + private readonly struct RouteEntry + { + public MetadataPopulator MetadataPopulator { get; init; } + public RequestDelegateFactoryFunc RequestDelegateFactory { get; init; } + public RoutePattern RoutePattern { get; init; } + public Delegate RouteHandler { get; init; } + public IEnumerable HttpMethods { get; init; } + public RouteAttributes RouteAttributes { get; init; } + public ThrowOnAddAfterEndpointBuiltConventionCollection Conventions { get; init; } + public ThrowOnAddAfterEndpointBuiltConventionCollection FinallyConventions { get; init; } + } - private sealed class ConventionBuilder : IEndpointConventionBuilder + [Flags] + private enum RouteAttributes + { + // The endpoint was defined by a RequestDelegate, RequestDelegateFactory.Create() should be skipped unless there are endpoint filters. + None = 0, + // This was added as Delegate route handler, so RequestDelegateFactory.Create() should always be called. + RouteHandler = 1, + // This was added by MapFallback. + Fallback = 2, + } +} + +// This file class is only exposed to internal code via ICollection> in RouteEndpointBuilder where only Add is called. +{{GeneratedCodeAttribute}} +file class ThrowOnAddAfterEndpointBuiltConventionCollection : List>, ICollection> +{ + // We throw if someone tries to add conventions to the RouteEntry after endpoints have already been resolved meaning the conventions + // will not be observed given RouteEndpointDataSource is not meant to be dynamic and uses NullChangeToken.Singleton. + public bool IsReadOnly { get; set; } + void ICollection>.Add(Action convention) + { + if (IsReadOnly) { - private readonly ICollection> _conventions; - private readonly ICollection> _finallyConventions; - public ConventionBuilder(ICollection> conventions, ICollection> finallyConventions) - { - _conventions = conventions; - _finallyConventions = finallyConventions; - } - /// - /// Adds the specified convention to the builder. Conventions are used to customize instances. - /// - /// The convention to add to the builder. - public void Add(Action convention) - { - _conventions.Add(convention); - } - public void Finally(Action finalConvention) - { - _finallyConventions.Add(finalConvention); - } + throw new InvalidOperationException("Resources.RouteEndpointDataSource_ConventionsCannotBeModifiedAfterBuild"); } + Add(convention); + } +} + +{{GeneratedCodeAttribute}} +file class ConventionBuilder : IEndpointConventionBuilder +{ + private readonly ICollection> _conventions; + private readonly ICollection> _finallyConventions; + public ConventionBuilder(ICollection> conventions, ICollection> finallyConventions) + { + _conventions = conventions; + _finallyConventions = finallyConventions; + } + /// + /// Adds the specified convention to the builder. Conventions are used to customize instances. + /// + /// The convention to add to the builder. + public void Add(Action convention) + { + _conventions.Add(convention); + } + public void Finally(Action finalConvention) + { + _finallyConventions.Add(finalConvention); } } """; diff --git a/src/Http/Http.Extensions/gen/StaticRouteHandlerModel/StaticRouteHandlerModel.Emitter.cs b/src/Http/Http.Extensions/gen/StaticRouteHandlerModel/StaticRouteHandlerModel.Emitter.cs index 3d27d0e7b34c..2e1e9249e635 100644 --- a/src/Http/Http.Extensions/gen/StaticRouteHandlerModel/StaticRouteHandlerModel.Emitter.cs +++ b/src/Http/Http.Extensions/gen/StaticRouteHandlerModel/StaticRouteHandlerModel.Emitter.cs @@ -58,7 +58,7 @@ public static string EmitFilteredRequestHandler() async System.Threading.Tasks.Task RequestHandlerFiltered(Microsoft.AspNetCore.Http.HttpContext httpContext) { var result = await filteredInvocation(new DefaultEndpointFilterInvocationContext(httpContext)); - await ExecuteObjectResult(result, httpContext); + await GeneratedRouteBuilderExtensionsCore.ExecuteObjectResult(result, httpContext); } """; }