|
|
@@ -0,0 +1,1726 @@
|
|
|
+//------------------------------------------------------------------------------
|
|
|
+// <auto-generated>
|
|
|
+// This code was generated by a tool.
|
|
|
+//
|
|
|
+// Changes to this file may cause incorrect behavior and will be lost if
|
|
|
+// the code is regenerated.
|
|
|
+// </auto-generated>
|
|
|
+//------------------------------------------------------------------------------
|
|
|
+#nullable enable
|
|
|
+
|
|
|
+namespace Microsoft.AspNetCore.Builder
|
|
|
+{
|
|
|
+ %GENERATEDCODEATTRIBUTE%
|
|
|
+ internal class SourceKey
|
|
|
+ {
|
|
|
+ public string Path { get; init; }
|
|
|
+ public int Line { get; init; }
|
|
|
+
|
|
|
+ public SourceKey(string path, int line)
|
|
|
+ {
|
|
|
+ Path = path;
|
|
|
+ Line = line;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 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.
|
|
|
+ %GENERATEDCODEATTRIBUTE%
|
|
|
+ internal static class GenerateRouteBuilderEndpoints
|
|
|
+ {
|
|
|
+ private static readonly string[] GetVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Get };
|
|
|
+ private static readonly string[] PostVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Post };
|
|
|
+ private static readonly string[] PutVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Put };
|
|
|
+ private static readonly string[] DeleteVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Delete };
|
|
|
+ private static readonly string[] PatchVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Patch };
|
|
|
+
|
|
|
+ internal static global::Microsoft.AspNetCore.Builder.RouteHandlerBuilder MapGet(
|
|
|
+ this global::Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints,
|
|
|
+ [global::System.Diagnostics.CodeAnalysis.StringSyntax("Route")] string pattern,
|
|
|
+ global::System.Func<global::Microsoft.AspNetCore.Http.HttpContext, global::Microsoft.AspNetCore.Http.Generators.Tests.MyBindAsyncRecord, global::System.String> handler,
|
|
|
+ [global::System.Runtime.CompilerServices.CallerFilePath] string filePath = "",
|
|
|
+ [global::System.Runtime.CompilerServices.CallerLineNumber]int lineNumber = 0)
|
|
|
+ {
|
|
|
+ return global::Microsoft.AspNetCore.Http.Generated.GeneratedRouteBuilderExtensionsCore.MapCore(
|
|
|
+ endpoints,
|
|
|
+ pattern,
|
|
|
+ handler,
|
|
|
+ GetVerb,
|
|
|
+ filePath,
|
|
|
+ lineNumber);
|
|
|
+ }
|
|
|
+ internal static global::Microsoft.AspNetCore.Builder.RouteHandlerBuilder MapGet(
|
|
|
+ this global::Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints,
|
|
|
+ [global::System.Diagnostics.CodeAnalysis.StringSyntax("Route")] string pattern,
|
|
|
+ global::System.Func<global::Microsoft.AspNetCore.Http.Generators.Tests.MyBindAsyncRecord?, global::System.String> handler,
|
|
|
+ [global::System.Runtime.CompilerServices.CallerFilePath] string filePath = "",
|
|
|
+ [global::System.Runtime.CompilerServices.CallerLineNumber]int lineNumber = 0)
|
|
|
+ {
|
|
|
+ return global::Microsoft.AspNetCore.Http.Generated.GeneratedRouteBuilderExtensionsCore.MapCore(
|
|
|
+ endpoints,
|
|
|
+ pattern,
|
|
|
+ handler,
|
|
|
+ GetVerb,
|
|
|
+ filePath,
|
|
|
+ lineNumber);
|
|
|
+ }
|
|
|
+ internal static global::Microsoft.AspNetCore.Builder.RouteHandlerBuilder MapGet(
|
|
|
+ this global::Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints,
|
|
|
+ [global::System.Diagnostics.CodeAnalysis.StringSyntax("Route")] string pattern,
|
|
|
+ global::System.Func<global::Microsoft.AspNetCore.Http.HttpContext, global::Microsoft.AspNetCore.Http.Generators.Tests.MyBindAsyncStruct, global::System.String> handler,
|
|
|
+ [global::System.Runtime.CompilerServices.CallerFilePath] string filePath = "",
|
|
|
+ [global::System.Runtime.CompilerServices.CallerLineNumber]int lineNumber = 0)
|
|
|
+ {
|
|
|
+ return global::Microsoft.AspNetCore.Http.Generated.GeneratedRouteBuilderExtensionsCore.MapCore(
|
|
|
+ endpoints,
|
|
|
+ pattern,
|
|
|
+ handler,
|
|
|
+ GetVerb,
|
|
|
+ filePath,
|
|
|
+ lineNumber);
|
|
|
+ }
|
|
|
+ internal static global::Microsoft.AspNetCore.Builder.RouteHandlerBuilder MapGet(
|
|
|
+ this global::Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints,
|
|
|
+ [global::System.Diagnostics.CodeAnalysis.StringSyntax("Route")] string pattern,
|
|
|
+ global::System.Func<global::Microsoft.AspNetCore.Http.Generators.Tests.MyBindAsyncStruct?, global::System.String> handler,
|
|
|
+ [global::System.Runtime.CompilerServices.CallerFilePath] string filePath = "",
|
|
|
+ [global::System.Runtime.CompilerServices.CallerLineNumber]int lineNumber = 0)
|
|
|
+ {
|
|
|
+ return global::Microsoft.AspNetCore.Http.Generated.GeneratedRouteBuilderExtensionsCore.MapCore(
|
|
|
+ endpoints,
|
|
|
+ pattern,
|
|
|
+ handler,
|
|
|
+ GetVerb,
|
|
|
+ filePath,
|
|
|
+ lineNumber);
|
|
|
+ }
|
|
|
+ internal static global::Microsoft.AspNetCore.Builder.RouteHandlerBuilder MapGet(
|
|
|
+ this global::Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints,
|
|
|
+ [global::System.Diagnostics.CodeAnalysis.StringSyntax("Route")] string pattern,
|
|
|
+ global::System.Func<global::Microsoft.AspNetCore.Http.HttpContext, global::Microsoft.AspNetCore.Http.Generators.Tests.MyNullableBindAsyncStruct, global::System.String> handler,
|
|
|
+ [global::System.Runtime.CompilerServices.CallerFilePath] string filePath = "",
|
|
|
+ [global::System.Runtime.CompilerServices.CallerLineNumber]int lineNumber = 0)
|
|
|
+ {
|
|
|
+ return global::Microsoft.AspNetCore.Http.Generated.GeneratedRouteBuilderExtensionsCore.MapCore(
|
|
|
+ endpoints,
|
|
|
+ pattern,
|
|
|
+ handler,
|
|
|
+ GetVerb,
|
|
|
+ filePath,
|
|
|
+ lineNumber);
|
|
|
+ }
|
|
|
+ internal static global::Microsoft.AspNetCore.Builder.RouteHandlerBuilder MapGet(
|
|
|
+ this global::Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints,
|
|
|
+ [global::System.Diagnostics.CodeAnalysis.StringSyntax("Route")] string pattern,
|
|
|
+ global::System.Func<global::Microsoft.AspNetCore.Http.Generators.Tests.MyNullableBindAsyncStruct?, global::System.String> handler,
|
|
|
+ [global::System.Runtime.CompilerServices.CallerFilePath] string filePath = "",
|
|
|
+ [global::System.Runtime.CompilerServices.CallerLineNumber]int lineNumber = 0)
|
|
|
+ {
|
|
|
+ return global::Microsoft.AspNetCore.Http.Generated.GeneratedRouteBuilderExtensionsCore.MapCore(
|
|
|
+ endpoints,
|
|
|
+ pattern,
|
|
|
+ handler,
|
|
|
+ GetVerb,
|
|
|
+ filePath,
|
|
|
+ lineNumber);
|
|
|
+ }
|
|
|
+ internal static global::Microsoft.AspNetCore.Builder.RouteHandlerBuilder MapGet(
|
|
|
+ this global::Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints,
|
|
|
+ [global::System.Diagnostics.CodeAnalysis.StringSyntax("Route")] string pattern,
|
|
|
+ global::System.Func<global::Microsoft.AspNetCore.Http.HttpContext, global::Microsoft.AspNetCore.Http.Generators.Tests.MyBothBindAsyncStruct, global::System.String> handler,
|
|
|
+ [global::System.Runtime.CompilerServices.CallerFilePath] string filePath = "",
|
|
|
+ [global::System.Runtime.CompilerServices.CallerLineNumber]int lineNumber = 0)
|
|
|
+ {
|
|
|
+ return global::Microsoft.AspNetCore.Http.Generated.GeneratedRouteBuilderExtensionsCore.MapCore(
|
|
|
+ endpoints,
|
|
|
+ pattern,
|
|
|
+ handler,
|
|
|
+ GetVerb,
|
|
|
+ filePath,
|
|
|
+ lineNumber);
|
|
|
+ }
|
|
|
+ internal static global::Microsoft.AspNetCore.Builder.RouteHandlerBuilder MapGet(
|
|
|
+ this global::Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints,
|
|
|
+ [global::System.Diagnostics.CodeAnalysis.StringSyntax("Route")] string pattern,
|
|
|
+ global::System.Func<global::Microsoft.AspNetCore.Http.Generators.Tests.MyBothBindAsyncStruct?, global::System.String> handler,
|
|
|
+ [global::System.Runtime.CompilerServices.CallerFilePath] string filePath = "",
|
|
|
+ [global::System.Runtime.CompilerServices.CallerLineNumber]int lineNumber = 0)
|
|
|
+ {
|
|
|
+ return global::Microsoft.AspNetCore.Http.Generated.GeneratedRouteBuilderExtensionsCore.MapCore(
|
|
|
+ endpoints,
|
|
|
+ pattern,
|
|
|
+ handler,
|
|
|
+ GetVerb,
|
|
|
+ filePath,
|
|
|
+ lineNumber);
|
|
|
+ }
|
|
|
+ internal static global::Microsoft.AspNetCore.Builder.RouteHandlerBuilder MapGet(
|
|
|
+ this global::Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints,
|
|
|
+ [global::System.Diagnostics.CodeAnalysis.StringSyntax("Route")] string pattern,
|
|
|
+ global::System.Func<global::Microsoft.AspNetCore.Http.HttpContext, global::Microsoft.AspNetCore.Http.Generators.Tests.MySimpleBindAsyncRecord, global::System.String> handler,
|
|
|
+ [global::System.Runtime.CompilerServices.CallerFilePath] string filePath = "",
|
|
|
+ [global::System.Runtime.CompilerServices.CallerLineNumber]int lineNumber = 0)
|
|
|
+ {
|
|
|
+ return global::Microsoft.AspNetCore.Http.Generated.GeneratedRouteBuilderExtensionsCore.MapCore(
|
|
|
+ endpoints,
|
|
|
+ pattern,
|
|
|
+ handler,
|
|
|
+ GetVerb,
|
|
|
+ filePath,
|
|
|
+ lineNumber);
|
|
|
+ }
|
|
|
+ internal static global::Microsoft.AspNetCore.Builder.RouteHandlerBuilder MapGet(
|
|
|
+ this global::Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints,
|
|
|
+ [global::System.Diagnostics.CodeAnalysis.StringSyntax("Route")] string pattern,
|
|
|
+ global::System.Func<global::Microsoft.AspNetCore.Http.Generators.Tests.MySimpleBindAsyncRecord?, global::System.String> handler,
|
|
|
+ [global::System.Runtime.CompilerServices.CallerFilePath] string filePath = "",
|
|
|
+ [global::System.Runtime.CompilerServices.CallerLineNumber]int lineNumber = 0)
|
|
|
+ {
|
|
|
+ return global::Microsoft.AspNetCore.Http.Generated.GeneratedRouteBuilderExtensionsCore.MapCore(
|
|
|
+ endpoints,
|
|
|
+ pattern,
|
|
|
+ handler,
|
|
|
+ GetVerb,
|
|
|
+ filePath,
|
|
|
+ lineNumber);
|
|
|
+ }
|
|
|
+ internal static global::Microsoft.AspNetCore.Builder.RouteHandlerBuilder MapGet(
|
|
|
+ this global::Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints,
|
|
|
+ [global::System.Diagnostics.CodeAnalysis.StringSyntax("Route")] string pattern,
|
|
|
+ global::System.Func<global::Microsoft.AspNetCore.Http.HttpContext, global::Microsoft.AspNetCore.Http.Generators.Tests.MySimpleBindAsyncStruct, global::System.String> handler,
|
|
|
+ [global::System.Runtime.CompilerServices.CallerFilePath] string filePath = "",
|
|
|
+ [global::System.Runtime.CompilerServices.CallerLineNumber]int lineNumber = 0)
|
|
|
+ {
|
|
|
+ return global::Microsoft.AspNetCore.Http.Generated.GeneratedRouteBuilderExtensionsCore.MapCore(
|
|
|
+ endpoints,
|
|
|
+ pattern,
|
|
|
+ handler,
|
|
|
+ GetVerb,
|
|
|
+ filePath,
|
|
|
+ lineNumber);
|
|
|
+ }
|
|
|
+ internal static global::Microsoft.AspNetCore.Builder.RouteHandlerBuilder MapGet(
|
|
|
+ this global::Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints,
|
|
|
+ [global::System.Diagnostics.CodeAnalysis.StringSyntax("Route")] string pattern,
|
|
|
+ global::System.Func<global::Microsoft.AspNetCore.Http.Generators.Tests.MySimpleBindAsyncStruct?, global::System.String> handler,
|
|
|
+ [global::System.Runtime.CompilerServices.CallerFilePath] string filePath = "",
|
|
|
+ [global::System.Runtime.CompilerServices.CallerLineNumber]int lineNumber = 0)
|
|
|
+ {
|
|
|
+ return global::Microsoft.AspNetCore.Http.Generated.GeneratedRouteBuilderExtensionsCore.MapCore(
|
|
|
+ endpoints,
|
|
|
+ pattern,
|
|
|
+ handler,
|
|
|
+ GetVerb,
|
|
|
+ filePath,
|
|
|
+ lineNumber);
|
|
|
+ }
|
|
|
+ internal static global::Microsoft.AspNetCore.Builder.RouteHandlerBuilder MapGet(
|
|
|
+ this global::Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints,
|
|
|
+ [global::System.Diagnostics.CodeAnalysis.StringSyntax("Route")] string pattern,
|
|
|
+ global::System.Func<global::Microsoft.AspNetCore.Http.HttpContext, global::Microsoft.AspNetCore.Http.Generators.Tests.BindAsyncFromImplicitStaticAbstractInterface, global::System.String> handler,
|
|
|
+ [global::System.Runtime.CompilerServices.CallerFilePath] string filePath = "",
|
|
|
+ [global::System.Runtime.CompilerServices.CallerLineNumber]int lineNumber = 0)
|
|
|
+ {
|
|
|
+ return global::Microsoft.AspNetCore.Http.Generated.GeneratedRouteBuilderExtensionsCore.MapCore(
|
|
|
+ endpoints,
|
|
|
+ pattern,
|
|
|
+ handler,
|
|
|
+ GetVerb,
|
|
|
+ filePath,
|
|
|
+ lineNumber);
|
|
|
+ }
|
|
|
+ internal static global::Microsoft.AspNetCore.Builder.RouteHandlerBuilder MapGet(
|
|
|
+ this global::Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints,
|
|
|
+ [global::System.Diagnostics.CodeAnalysis.StringSyntax("Route")] string pattern,
|
|
|
+ global::System.Func<global::Microsoft.AspNetCore.Http.Generators.Tests.BindAsyncFromImplicitStaticAbstractInterface?, global::System.String> handler,
|
|
|
+ [global::System.Runtime.CompilerServices.CallerFilePath] string filePath = "",
|
|
|
+ [global::System.Runtime.CompilerServices.CallerLineNumber]int lineNumber = 0)
|
|
|
+ {
|
|
|
+ return global::Microsoft.AspNetCore.Http.Generated.GeneratedRouteBuilderExtensionsCore.MapCore(
|
|
|
+ endpoints,
|
|
|
+ pattern,
|
|
|
+ handler,
|
|
|
+ GetVerb,
|
|
|
+ filePath,
|
|
|
+ lineNumber);
|
|
|
+ }
|
|
|
+ internal static global::Microsoft.AspNetCore.Builder.RouteHandlerBuilder MapGet(
|
|
|
+ this global::Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints,
|
|
|
+ [global::System.Diagnostics.CodeAnalysis.StringSyntax("Route")] string pattern,
|
|
|
+ global::System.Func<global::Microsoft.AspNetCore.Http.HttpContext, global::Microsoft.AspNetCore.Http.Generators.Tests.InheritBindAsync, global::System.String> handler,
|
|
|
+ [global::System.Runtime.CompilerServices.CallerFilePath] string filePath = "",
|
|
|
+ [global::System.Runtime.CompilerServices.CallerLineNumber]int lineNumber = 0)
|
|
|
+ {
|
|
|
+ return global::Microsoft.AspNetCore.Http.Generated.GeneratedRouteBuilderExtensionsCore.MapCore(
|
|
|
+ endpoints,
|
|
|
+ pattern,
|
|
|
+ handler,
|
|
|
+ GetVerb,
|
|
|
+ filePath,
|
|
|
+ lineNumber);
|
|
|
+ }
|
|
|
+ internal static global::Microsoft.AspNetCore.Builder.RouteHandlerBuilder MapGet(
|
|
|
+ this global::Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints,
|
|
|
+ [global::System.Diagnostics.CodeAnalysis.StringSyntax("Route")] string pattern,
|
|
|
+ global::System.Func<global::Microsoft.AspNetCore.Http.Generators.Tests.InheritBindAsync?, global::System.String> handler,
|
|
|
+ [global::System.Runtime.CompilerServices.CallerFilePath] string filePath = "",
|
|
|
+ [global::System.Runtime.CompilerServices.CallerLineNumber]int lineNumber = 0)
|
|
|
+ {
|
|
|
+ return global::Microsoft.AspNetCore.Http.Generated.GeneratedRouteBuilderExtensionsCore.MapCore(
|
|
|
+ endpoints,
|
|
|
+ pattern,
|
|
|
+ handler,
|
|
|
+ GetVerb,
|
|
|
+ filePath,
|
|
|
+ lineNumber);
|
|
|
+ }
|
|
|
+ internal static global::Microsoft.AspNetCore.Builder.RouteHandlerBuilder MapGet(
|
|
|
+ this global::Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints,
|
|
|
+ [global::System.Diagnostics.CodeAnalysis.StringSyntax("Route")] string pattern,
|
|
|
+ global::System.Func<global::Microsoft.AspNetCore.Http.HttpContext, global::Microsoft.AspNetCore.Http.Generators.Tests.BindAsyncFromExplicitStaticAbstractInterface, global::System.String> handler,
|
|
|
+ [global::System.Runtime.CompilerServices.CallerFilePath] string filePath = "",
|
|
|
+ [global::System.Runtime.CompilerServices.CallerLineNumber]int lineNumber = 0)
|
|
|
+ {
|
|
|
+ return global::Microsoft.AspNetCore.Http.Generated.GeneratedRouteBuilderExtensionsCore.MapCore(
|
|
|
+ endpoints,
|
|
|
+ pattern,
|
|
|
+ handler,
|
|
|
+ GetVerb,
|
|
|
+ filePath,
|
|
|
+ lineNumber);
|
|
|
+ }
|
|
|
+ internal static global::Microsoft.AspNetCore.Builder.RouteHandlerBuilder MapGet(
|
|
|
+ this global::Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints,
|
|
|
+ [global::System.Diagnostics.CodeAnalysis.StringSyntax("Route")] string pattern,
|
|
|
+ global::System.Func<global::Microsoft.AspNetCore.Http.Generators.Tests.BindAsyncFromExplicitStaticAbstractInterface?, global::System.String> handler,
|
|
|
+ [global::System.Runtime.CompilerServices.CallerFilePath] string filePath = "",
|
|
|
+ [global::System.Runtime.CompilerServices.CallerLineNumber]int lineNumber = 0)
|
|
|
+ {
|
|
|
+ return global::Microsoft.AspNetCore.Http.Generated.GeneratedRouteBuilderExtensionsCore.MapCore(
|
|
|
+ endpoints,
|
|
|
+ pattern,
|
|
|
+ handler,
|
|
|
+ GetVerb,
|
|
|
+ filePath,
|
|
|
+ lineNumber);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+namespace Microsoft.AspNetCore.Http.Generated
|
|
|
+{
|
|
|
+ using System;
|
|
|
+ using System.Collections;
|
|
|
+ using System.Collections.Generic;
|
|
|
+ using System.Collections.ObjectModel;
|
|
|
+ using System.Diagnostics;
|
|
|
+ using System.Diagnostics.CodeAnalysis;
|
|
|
+ using System.Globalization;
|
|
|
+ using System.Linq;
|
|
|
+ using System.Reflection;
|
|
|
+ using System.Text.Json;
|
|
|
+ using System.Text.Json.Serialization.Metadata;
|
|
|
+ using System.Threading.Tasks;
|
|
|
+ using System.IO;
|
|
|
+ using Microsoft.AspNetCore.Routing;
|
|
|
+ using Microsoft.AspNetCore.Routing.Patterns;
|
|
|
+ using Microsoft.AspNetCore.Builder;
|
|
|
+ using Microsoft.AspNetCore.Http;
|
|
|
+ using Microsoft.AspNetCore.Http.Json;
|
|
|
+ using Microsoft.AspNetCore.Http.Metadata;
|
|
|
+ using Microsoft.Extensions.DependencyInjection;
|
|
|
+ using Microsoft.Extensions.FileProviders;
|
|
|
+ using Microsoft.Extensions.Primitives;
|
|
|
+ using Microsoft.Extensions.Options;
|
|
|
+
|
|
|
+ using MetadataPopulator = System.Func<System.Reflection.MethodInfo, Microsoft.AspNetCore.Http.RequestDelegateFactoryOptions?, Microsoft.AspNetCore.Http.RequestDelegateMetadataResult>;
|
|
|
+ using RequestDelegateFactoryFunc = System.Func<System.Delegate, Microsoft.AspNetCore.Http.RequestDelegateFactoryOptions, Microsoft.AspNetCore.Http.RequestDelegateMetadataResult?, Microsoft.AspNetCore.Http.RequestDelegateResult>;
|
|
|
+
|
|
|
+ file static class GeneratedRouteBuilderExtensionsCore
|
|
|
+ {
|
|
|
+
|
|
|
+ private static readonly Dictionary<(string, int), (MetadataPopulator, RequestDelegateFactoryFunc)> map = new()
|
|
|
+ {
|
|
|
+ [(@"TestMapActions.cs", 24)] = (
|
|
|
+ (methodInfo, options) =>
|
|
|
+ {
|
|
|
+ Debug.Assert(options?.EndpointBuilder != null, "EndpointBuilder not found.");
|
|
|
+ options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 24));
|
|
|
+ return new RequestDelegateMetadataResult { EndpointMetadata = options.EndpointBuilder.Metadata.AsReadOnly() };
|
|
|
+ },
|
|
|
+ (del, options, inferredMetadataResult) =>
|
|
|
+ {
|
|
|
+ var handler = (Func<global::Microsoft.AspNetCore.Http.HttpContext, global::Microsoft.AspNetCore.Http.Generators.Tests.MyBindAsyncRecord, global::System.String>)del;
|
|
|
+ EndpointFilterDelegate? filteredInvocation = null;
|
|
|
+ var parameters = del.Method.GetParameters();
|
|
|
+
|
|
|
+ if (options?.EndpointBuilder?.FilterFactories.Count > 0)
|
|
|
+ {
|
|
|
+ filteredInvocation = GeneratedRouteBuilderExtensionsCore.BuildFilterDelegate(ic =>
|
|
|
+ {
|
|
|
+ if (ic.HttpContext.Response.StatusCode == 400)
|
|
|
+ {
|
|
|
+ return ValueTask.FromResult<object?>(Results.Empty);
|
|
|
+ }
|
|
|
+ return ValueTask.FromResult<object?>(handler(ic.GetArgument<global::Microsoft.AspNetCore.Http.HttpContext>(0), ic.GetArgument<global::Microsoft.AspNetCore.Http.Generators.Tests.MyBindAsyncRecord>(1)));
|
|
|
+ },
|
|
|
+ options.EndpointBuilder,
|
|
|
+ handler.Method);
|
|
|
+ }
|
|
|
+
|
|
|
+ async Task RequestHandler(HttpContext httpContext)
|
|
|
+ {
|
|
|
+ var wasParamCheckFailure = false;
|
|
|
+ var httpContext_local = httpContext;
|
|
|
+ var myBindAsyncParam_temp = await global::Microsoft.AspNetCore.Http.Generators.Tests.MyBindAsyncRecord.BindAsync(httpContext, parameters[1]);
|
|
|
+ global::Microsoft.AspNetCore.Http.Generators.Tests.MyBindAsyncRecord myBindAsyncParam_local;
|
|
|
+ if ((object?)myBindAsyncParam_temp == null)
|
|
|
+ {
|
|
|
+ wasParamCheckFailure = true;
|
|
|
+ myBindAsyncParam_local = default!;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ myBindAsyncParam_local = (global::Microsoft.AspNetCore.Http.Generators.Tests.MyBindAsyncRecord)myBindAsyncParam_temp;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (wasParamCheckFailure)
|
|
|
+ {
|
|
|
+ httpContext.Response.StatusCode = 400;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ httpContext.Response.ContentType ??= "text/plain";
|
|
|
+ var result = handler(httpContext_local, myBindAsyncParam_local);
|
|
|
+ await httpContext.Response.WriteAsync(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ async Task RequestHandlerFiltered(HttpContext httpContext)
|
|
|
+ {
|
|
|
+ var wasParamCheckFailure = false;
|
|
|
+ var httpContext_local = httpContext;
|
|
|
+ var myBindAsyncParam_temp = await global::Microsoft.AspNetCore.Http.Generators.Tests.MyBindAsyncRecord.BindAsync(httpContext, parameters[1]);
|
|
|
+ global::Microsoft.AspNetCore.Http.Generators.Tests.MyBindAsyncRecord myBindAsyncParam_local;
|
|
|
+ if ((object?)myBindAsyncParam_temp == null)
|
|
|
+ {
|
|
|
+ wasParamCheckFailure = true;
|
|
|
+ myBindAsyncParam_local = default!;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ myBindAsyncParam_local = (global::Microsoft.AspNetCore.Http.Generators.Tests.MyBindAsyncRecord)myBindAsyncParam_temp;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (wasParamCheckFailure)
|
|
|
+ {
|
|
|
+ httpContext.Response.StatusCode = 400;
|
|
|
+ }
|
|
|
+ var result = await filteredInvocation(EndpointFilterInvocationContext.Create<global::Microsoft.AspNetCore.Http.HttpContext, global::Microsoft.AspNetCore.Http.Generators.Tests.MyBindAsyncRecord>(httpContext, httpContext_local, myBindAsyncParam_local));
|
|
|
+ await GeneratedRouteBuilderExtensionsCore.ExecuteObjectResult(result, httpContext);
|
|
|
+ }
|
|
|
+
|
|
|
+ RequestDelegate targetDelegate = filteredInvocation is null ? RequestHandler : RequestHandlerFiltered;
|
|
|
+ var metadata = inferredMetadataResult?.EndpointMetadata ?? ReadOnlyCollection<object>.Empty;
|
|
|
+ return new RequestDelegateResult(targetDelegate, metadata);
|
|
|
+ }),
|
|
|
+ [(@"TestMapActions.cs", 25)] = (
|
|
|
+ (methodInfo, options) =>
|
|
|
+ {
|
|
|
+ Debug.Assert(options?.EndpointBuilder != null, "EndpointBuilder not found.");
|
|
|
+ options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 25));
|
|
|
+ return new RequestDelegateMetadataResult { EndpointMetadata = options.EndpointBuilder.Metadata.AsReadOnly() };
|
|
|
+ },
|
|
|
+ (del, options, inferredMetadataResult) =>
|
|
|
+ {
|
|
|
+ var handler = (Func<global::Microsoft.AspNetCore.Http.Generators.Tests.MyBindAsyncRecord?, global::System.String>)del;
|
|
|
+ EndpointFilterDelegate? filteredInvocation = null;
|
|
|
+ var parameters = del.Method.GetParameters();
|
|
|
+
|
|
|
+ if (options?.EndpointBuilder?.FilterFactories.Count > 0)
|
|
|
+ {
|
|
|
+ filteredInvocation = GeneratedRouteBuilderExtensionsCore.BuildFilterDelegate(ic =>
|
|
|
+ {
|
|
|
+ if (ic.HttpContext.Response.StatusCode == 400)
|
|
|
+ {
|
|
|
+ return ValueTask.FromResult<object?>(Results.Empty);
|
|
|
+ }
|
|
|
+ return ValueTask.FromResult<object?>(handler(ic.GetArgument<global::Microsoft.AspNetCore.Http.Generators.Tests.MyBindAsyncRecord?>(0)));
|
|
|
+ },
|
|
|
+ options.EndpointBuilder,
|
|
|
+ handler.Method);
|
|
|
+ }
|
|
|
+
|
|
|
+ async Task RequestHandler(HttpContext httpContext)
|
|
|
+ {
|
|
|
+ var wasParamCheckFailure = false;
|
|
|
+ var myBindAsyncParam_temp = await global::Microsoft.AspNetCore.Http.Generators.Tests.MyBindAsyncRecord.BindAsync(httpContext, parameters[0]);
|
|
|
+ var myBindAsyncParam_local = (global::Microsoft.AspNetCore.Http.Generators.Tests.MyBindAsyncRecord?)myBindAsyncParam_temp;
|
|
|
+
|
|
|
+ if (wasParamCheckFailure)
|
|
|
+ {
|
|
|
+ httpContext.Response.StatusCode = 400;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ httpContext.Response.ContentType ??= "text/plain";
|
|
|
+ var result = handler(myBindAsyncParam_local);
|
|
|
+ await httpContext.Response.WriteAsync(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ async Task RequestHandlerFiltered(HttpContext httpContext)
|
|
|
+ {
|
|
|
+ var wasParamCheckFailure = false;
|
|
|
+ var myBindAsyncParam_temp = await global::Microsoft.AspNetCore.Http.Generators.Tests.MyBindAsyncRecord.BindAsync(httpContext, parameters[0]);
|
|
|
+ var myBindAsyncParam_local = (global::Microsoft.AspNetCore.Http.Generators.Tests.MyBindAsyncRecord?)myBindAsyncParam_temp;
|
|
|
+
|
|
|
+ if (wasParamCheckFailure)
|
|
|
+ {
|
|
|
+ httpContext.Response.StatusCode = 400;
|
|
|
+ }
|
|
|
+ var result = await filteredInvocation(EndpointFilterInvocationContext.Create<global::Microsoft.AspNetCore.Http.Generators.Tests.MyBindAsyncRecord?>(httpContext, myBindAsyncParam_local));
|
|
|
+ await GeneratedRouteBuilderExtensionsCore.ExecuteObjectResult(result, httpContext);
|
|
|
+ }
|
|
|
+
|
|
|
+ RequestDelegate targetDelegate = filteredInvocation is null ? RequestHandler : RequestHandlerFiltered;
|
|
|
+ var metadata = inferredMetadataResult?.EndpointMetadata ?? ReadOnlyCollection<object>.Empty;
|
|
|
+ return new RequestDelegateResult(targetDelegate, metadata);
|
|
|
+ }),
|
|
|
+ [(@"TestMapActions.cs", 26)] = (
|
|
|
+ (methodInfo, options) =>
|
|
|
+ {
|
|
|
+ Debug.Assert(options?.EndpointBuilder != null, "EndpointBuilder not found.");
|
|
|
+ options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 26));
|
|
|
+ return new RequestDelegateMetadataResult { EndpointMetadata = options.EndpointBuilder.Metadata.AsReadOnly() };
|
|
|
+ },
|
|
|
+ (del, options, inferredMetadataResult) =>
|
|
|
+ {
|
|
|
+ var handler = (Func<global::Microsoft.AspNetCore.Http.HttpContext, global::Microsoft.AspNetCore.Http.Generators.Tests.MyBindAsyncStruct, global::System.String>)del;
|
|
|
+ EndpointFilterDelegate? filteredInvocation = null;
|
|
|
+ var parameters = del.Method.GetParameters();
|
|
|
+
|
|
|
+ if (options?.EndpointBuilder?.FilterFactories.Count > 0)
|
|
|
+ {
|
|
|
+ filteredInvocation = GeneratedRouteBuilderExtensionsCore.BuildFilterDelegate(ic =>
|
|
|
+ {
|
|
|
+ if (ic.HttpContext.Response.StatusCode == 400)
|
|
|
+ {
|
|
|
+ return ValueTask.FromResult<object?>(Results.Empty);
|
|
|
+ }
|
|
|
+ return ValueTask.FromResult<object?>(handler(ic.GetArgument<global::Microsoft.AspNetCore.Http.HttpContext>(0), ic.GetArgument<global::Microsoft.AspNetCore.Http.Generators.Tests.MyBindAsyncStruct>(1)));
|
|
|
+ },
|
|
|
+ options.EndpointBuilder,
|
|
|
+ handler.Method);
|
|
|
+ }
|
|
|
+
|
|
|
+ async Task RequestHandler(HttpContext httpContext)
|
|
|
+ {
|
|
|
+ var wasParamCheckFailure = false;
|
|
|
+ var httpContext_local = httpContext;
|
|
|
+ var myBindAsyncParam_temp = await global::Microsoft.AspNetCore.Http.Generators.Tests.MyBindAsyncStruct.BindAsync(httpContext, parameters[1]);
|
|
|
+ global::Microsoft.AspNetCore.Http.Generators.Tests.MyBindAsyncStruct myBindAsyncParam_local;
|
|
|
+ if ((object?)myBindAsyncParam_temp == null)
|
|
|
+ {
|
|
|
+ wasParamCheckFailure = true;
|
|
|
+ myBindAsyncParam_local = default!;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ myBindAsyncParam_local = (global::Microsoft.AspNetCore.Http.Generators.Tests.MyBindAsyncStruct)myBindAsyncParam_temp;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (wasParamCheckFailure)
|
|
|
+ {
|
|
|
+ httpContext.Response.StatusCode = 400;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ httpContext.Response.ContentType ??= "text/plain";
|
|
|
+ var result = handler(httpContext_local, myBindAsyncParam_local);
|
|
|
+ await httpContext.Response.WriteAsync(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ async Task RequestHandlerFiltered(HttpContext httpContext)
|
|
|
+ {
|
|
|
+ var wasParamCheckFailure = false;
|
|
|
+ var httpContext_local = httpContext;
|
|
|
+ var myBindAsyncParam_temp = await global::Microsoft.AspNetCore.Http.Generators.Tests.MyBindAsyncStruct.BindAsync(httpContext, parameters[1]);
|
|
|
+ global::Microsoft.AspNetCore.Http.Generators.Tests.MyBindAsyncStruct myBindAsyncParam_local;
|
|
|
+ if ((object?)myBindAsyncParam_temp == null)
|
|
|
+ {
|
|
|
+ wasParamCheckFailure = true;
|
|
|
+ myBindAsyncParam_local = default!;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ myBindAsyncParam_local = (global::Microsoft.AspNetCore.Http.Generators.Tests.MyBindAsyncStruct)myBindAsyncParam_temp;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (wasParamCheckFailure)
|
|
|
+ {
|
|
|
+ httpContext.Response.StatusCode = 400;
|
|
|
+ }
|
|
|
+ var result = await filteredInvocation(EndpointFilterInvocationContext.Create<global::Microsoft.AspNetCore.Http.HttpContext, global::Microsoft.AspNetCore.Http.Generators.Tests.MyBindAsyncStruct>(httpContext, httpContext_local, myBindAsyncParam_local));
|
|
|
+ await GeneratedRouteBuilderExtensionsCore.ExecuteObjectResult(result, httpContext);
|
|
|
+ }
|
|
|
+
|
|
|
+ RequestDelegate targetDelegate = filteredInvocation is null ? RequestHandler : RequestHandlerFiltered;
|
|
|
+ var metadata = inferredMetadataResult?.EndpointMetadata ?? ReadOnlyCollection<object>.Empty;
|
|
|
+ return new RequestDelegateResult(targetDelegate, metadata);
|
|
|
+ }),
|
|
|
+ [(@"TestMapActions.cs", 27)] = (
|
|
|
+ (methodInfo, options) =>
|
|
|
+ {
|
|
|
+ Debug.Assert(options?.EndpointBuilder != null, "EndpointBuilder not found.");
|
|
|
+ options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 27));
|
|
|
+ return new RequestDelegateMetadataResult { EndpointMetadata = options.EndpointBuilder.Metadata.AsReadOnly() };
|
|
|
+ },
|
|
|
+ (del, options, inferredMetadataResult) =>
|
|
|
+ {
|
|
|
+ var handler = (Func<global::Microsoft.AspNetCore.Http.Generators.Tests.MyBindAsyncStruct?, global::System.String>)del;
|
|
|
+ EndpointFilterDelegate? filteredInvocation = null;
|
|
|
+ var parameters = del.Method.GetParameters();
|
|
|
+
|
|
|
+ if (options?.EndpointBuilder?.FilterFactories.Count > 0)
|
|
|
+ {
|
|
|
+ filteredInvocation = GeneratedRouteBuilderExtensionsCore.BuildFilterDelegate(ic =>
|
|
|
+ {
|
|
|
+ if (ic.HttpContext.Response.StatusCode == 400)
|
|
|
+ {
|
|
|
+ return ValueTask.FromResult<object?>(Results.Empty);
|
|
|
+ }
|
|
|
+ return ValueTask.FromResult<object?>(handler(ic.GetArgument<global::Microsoft.AspNetCore.Http.Generators.Tests.MyBindAsyncStruct?>(0)));
|
|
|
+ },
|
|
|
+ options.EndpointBuilder,
|
|
|
+ handler.Method);
|
|
|
+ }
|
|
|
+
|
|
|
+ async Task RequestHandler(HttpContext httpContext)
|
|
|
+ {
|
|
|
+ var wasParamCheckFailure = false;
|
|
|
+ var myBindAsyncParam_temp = await global::Microsoft.AspNetCore.Http.Generators.Tests.MyBindAsyncStruct.BindAsync(httpContext, parameters[0]);
|
|
|
+ var myBindAsyncParam_local = (global::Microsoft.AspNetCore.Http.Generators.Tests.MyBindAsyncStruct?)myBindAsyncParam_temp;
|
|
|
+
|
|
|
+ if (wasParamCheckFailure)
|
|
|
+ {
|
|
|
+ httpContext.Response.StatusCode = 400;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ httpContext.Response.ContentType ??= "text/plain";
|
|
|
+ var result = handler(myBindAsyncParam_local);
|
|
|
+ await httpContext.Response.WriteAsync(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ async Task RequestHandlerFiltered(HttpContext httpContext)
|
|
|
+ {
|
|
|
+ var wasParamCheckFailure = false;
|
|
|
+ var myBindAsyncParam_temp = await global::Microsoft.AspNetCore.Http.Generators.Tests.MyBindAsyncStruct.BindAsync(httpContext, parameters[0]);
|
|
|
+ var myBindAsyncParam_local = (global::Microsoft.AspNetCore.Http.Generators.Tests.MyBindAsyncStruct?)myBindAsyncParam_temp;
|
|
|
+
|
|
|
+ if (wasParamCheckFailure)
|
|
|
+ {
|
|
|
+ httpContext.Response.StatusCode = 400;
|
|
|
+ }
|
|
|
+ var result = await filteredInvocation(EndpointFilterInvocationContext.Create<global::Microsoft.AspNetCore.Http.Generators.Tests.MyBindAsyncStruct?>(httpContext, myBindAsyncParam_local));
|
|
|
+ await GeneratedRouteBuilderExtensionsCore.ExecuteObjectResult(result, httpContext);
|
|
|
+ }
|
|
|
+
|
|
|
+ RequestDelegate targetDelegate = filteredInvocation is null ? RequestHandler : RequestHandlerFiltered;
|
|
|
+ var metadata = inferredMetadataResult?.EndpointMetadata ?? ReadOnlyCollection<object>.Empty;
|
|
|
+ return new RequestDelegateResult(targetDelegate, metadata);
|
|
|
+ }),
|
|
|
+ [(@"TestMapActions.cs", 28)] = (
|
|
|
+ (methodInfo, options) =>
|
|
|
+ {
|
|
|
+ Debug.Assert(options?.EndpointBuilder != null, "EndpointBuilder not found.");
|
|
|
+ options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 28));
|
|
|
+ return new RequestDelegateMetadataResult { EndpointMetadata = options.EndpointBuilder.Metadata.AsReadOnly() };
|
|
|
+ },
|
|
|
+ (del, options, inferredMetadataResult) =>
|
|
|
+ {
|
|
|
+ var handler = (Func<global::Microsoft.AspNetCore.Http.HttpContext, global::Microsoft.AspNetCore.Http.Generators.Tests.MyNullableBindAsyncStruct, global::System.String>)del;
|
|
|
+ EndpointFilterDelegate? filteredInvocation = null;
|
|
|
+ var parameters = del.Method.GetParameters();
|
|
|
+
|
|
|
+ if (options?.EndpointBuilder?.FilterFactories.Count > 0)
|
|
|
+ {
|
|
|
+ filteredInvocation = GeneratedRouteBuilderExtensionsCore.BuildFilterDelegate(ic =>
|
|
|
+ {
|
|
|
+ if (ic.HttpContext.Response.StatusCode == 400)
|
|
|
+ {
|
|
|
+ return ValueTask.FromResult<object?>(Results.Empty);
|
|
|
+ }
|
|
|
+ return ValueTask.FromResult<object?>(handler(ic.GetArgument<global::Microsoft.AspNetCore.Http.HttpContext>(0), ic.GetArgument<global::Microsoft.AspNetCore.Http.Generators.Tests.MyNullableBindAsyncStruct>(1)));
|
|
|
+ },
|
|
|
+ options.EndpointBuilder,
|
|
|
+ handler.Method);
|
|
|
+ }
|
|
|
+
|
|
|
+ async Task RequestHandler(HttpContext httpContext)
|
|
|
+ {
|
|
|
+ var wasParamCheckFailure = false;
|
|
|
+ var httpContext_local = httpContext;
|
|
|
+ var myBindAsyncParam_temp = await global::Microsoft.AspNetCore.Http.Generators.Tests.MyNullableBindAsyncStruct.BindAsync(httpContext, parameters[1]);
|
|
|
+ global::Microsoft.AspNetCore.Http.Generators.Tests.MyNullableBindAsyncStruct myBindAsyncParam_local;
|
|
|
+ if ((object?)myBindAsyncParam_temp == null)
|
|
|
+ {
|
|
|
+ wasParamCheckFailure = true;
|
|
|
+ myBindAsyncParam_local = default!;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ myBindAsyncParam_local = (global::Microsoft.AspNetCore.Http.Generators.Tests.MyNullableBindAsyncStruct)myBindAsyncParam_temp;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (wasParamCheckFailure)
|
|
|
+ {
|
|
|
+ httpContext.Response.StatusCode = 400;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ httpContext.Response.ContentType ??= "text/plain";
|
|
|
+ var result = handler(httpContext_local, myBindAsyncParam_local);
|
|
|
+ await httpContext.Response.WriteAsync(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ async Task RequestHandlerFiltered(HttpContext httpContext)
|
|
|
+ {
|
|
|
+ var wasParamCheckFailure = false;
|
|
|
+ var httpContext_local = httpContext;
|
|
|
+ var myBindAsyncParam_temp = await global::Microsoft.AspNetCore.Http.Generators.Tests.MyNullableBindAsyncStruct.BindAsync(httpContext, parameters[1]);
|
|
|
+ global::Microsoft.AspNetCore.Http.Generators.Tests.MyNullableBindAsyncStruct myBindAsyncParam_local;
|
|
|
+ if ((object?)myBindAsyncParam_temp == null)
|
|
|
+ {
|
|
|
+ wasParamCheckFailure = true;
|
|
|
+ myBindAsyncParam_local = default!;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ myBindAsyncParam_local = (global::Microsoft.AspNetCore.Http.Generators.Tests.MyNullableBindAsyncStruct)myBindAsyncParam_temp;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (wasParamCheckFailure)
|
|
|
+ {
|
|
|
+ httpContext.Response.StatusCode = 400;
|
|
|
+ }
|
|
|
+ var result = await filteredInvocation(EndpointFilterInvocationContext.Create<global::Microsoft.AspNetCore.Http.HttpContext, global::Microsoft.AspNetCore.Http.Generators.Tests.MyNullableBindAsyncStruct>(httpContext, httpContext_local, myBindAsyncParam_local));
|
|
|
+ await GeneratedRouteBuilderExtensionsCore.ExecuteObjectResult(result, httpContext);
|
|
|
+ }
|
|
|
+
|
|
|
+ RequestDelegate targetDelegate = filteredInvocation is null ? RequestHandler : RequestHandlerFiltered;
|
|
|
+ var metadata = inferredMetadataResult?.EndpointMetadata ?? ReadOnlyCollection<object>.Empty;
|
|
|
+ return new RequestDelegateResult(targetDelegate, metadata);
|
|
|
+ }),
|
|
|
+ [(@"TestMapActions.cs", 29)] = (
|
|
|
+ (methodInfo, options) =>
|
|
|
+ {
|
|
|
+ Debug.Assert(options?.EndpointBuilder != null, "EndpointBuilder not found.");
|
|
|
+ options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 29));
|
|
|
+ return new RequestDelegateMetadataResult { EndpointMetadata = options.EndpointBuilder.Metadata.AsReadOnly() };
|
|
|
+ },
|
|
|
+ (del, options, inferredMetadataResult) =>
|
|
|
+ {
|
|
|
+ var handler = (Func<global::Microsoft.AspNetCore.Http.Generators.Tests.MyNullableBindAsyncStruct?, global::System.String>)del;
|
|
|
+ EndpointFilterDelegate? filteredInvocation = null;
|
|
|
+ var parameters = del.Method.GetParameters();
|
|
|
+
|
|
|
+ if (options?.EndpointBuilder?.FilterFactories.Count > 0)
|
|
|
+ {
|
|
|
+ filteredInvocation = GeneratedRouteBuilderExtensionsCore.BuildFilterDelegate(ic =>
|
|
|
+ {
|
|
|
+ if (ic.HttpContext.Response.StatusCode == 400)
|
|
|
+ {
|
|
|
+ return ValueTask.FromResult<object?>(Results.Empty);
|
|
|
+ }
|
|
|
+ return ValueTask.FromResult<object?>(handler(ic.GetArgument<global::Microsoft.AspNetCore.Http.Generators.Tests.MyNullableBindAsyncStruct?>(0)));
|
|
|
+ },
|
|
|
+ options.EndpointBuilder,
|
|
|
+ handler.Method);
|
|
|
+ }
|
|
|
+
|
|
|
+ async Task RequestHandler(HttpContext httpContext)
|
|
|
+ {
|
|
|
+ var wasParamCheckFailure = false;
|
|
|
+ var myBindAsyncParam_temp = await global::Microsoft.AspNetCore.Http.Generators.Tests.MyNullableBindAsyncStruct.BindAsync(httpContext, parameters[0]);
|
|
|
+ var myBindAsyncParam_local = (global::Microsoft.AspNetCore.Http.Generators.Tests.MyNullableBindAsyncStruct?)myBindAsyncParam_temp;
|
|
|
+
|
|
|
+ if (wasParamCheckFailure)
|
|
|
+ {
|
|
|
+ httpContext.Response.StatusCode = 400;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ httpContext.Response.ContentType ??= "text/plain";
|
|
|
+ var result = handler(myBindAsyncParam_local);
|
|
|
+ await httpContext.Response.WriteAsync(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ async Task RequestHandlerFiltered(HttpContext httpContext)
|
|
|
+ {
|
|
|
+ var wasParamCheckFailure = false;
|
|
|
+ var myBindAsyncParam_temp = await global::Microsoft.AspNetCore.Http.Generators.Tests.MyNullableBindAsyncStruct.BindAsync(httpContext, parameters[0]);
|
|
|
+ var myBindAsyncParam_local = (global::Microsoft.AspNetCore.Http.Generators.Tests.MyNullableBindAsyncStruct?)myBindAsyncParam_temp;
|
|
|
+
|
|
|
+ if (wasParamCheckFailure)
|
|
|
+ {
|
|
|
+ httpContext.Response.StatusCode = 400;
|
|
|
+ }
|
|
|
+ var result = await filteredInvocation(EndpointFilterInvocationContext.Create<global::Microsoft.AspNetCore.Http.Generators.Tests.MyNullableBindAsyncStruct?>(httpContext, myBindAsyncParam_local));
|
|
|
+ await GeneratedRouteBuilderExtensionsCore.ExecuteObjectResult(result, httpContext);
|
|
|
+ }
|
|
|
+
|
|
|
+ RequestDelegate targetDelegate = filteredInvocation is null ? RequestHandler : RequestHandlerFiltered;
|
|
|
+ var metadata = inferredMetadataResult?.EndpointMetadata ?? ReadOnlyCollection<object>.Empty;
|
|
|
+ return new RequestDelegateResult(targetDelegate, metadata);
|
|
|
+ }),
|
|
|
+ [(@"TestMapActions.cs", 30)] = (
|
|
|
+ (methodInfo, options) =>
|
|
|
+ {
|
|
|
+ Debug.Assert(options?.EndpointBuilder != null, "EndpointBuilder not found.");
|
|
|
+ options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 30));
|
|
|
+ return new RequestDelegateMetadataResult { EndpointMetadata = options.EndpointBuilder.Metadata.AsReadOnly() };
|
|
|
+ },
|
|
|
+ (del, options, inferredMetadataResult) =>
|
|
|
+ {
|
|
|
+ var handler = (Func<global::Microsoft.AspNetCore.Http.HttpContext, global::Microsoft.AspNetCore.Http.Generators.Tests.MyBothBindAsyncStruct, global::System.String>)del;
|
|
|
+ EndpointFilterDelegate? filteredInvocation = null;
|
|
|
+ var parameters = del.Method.GetParameters();
|
|
|
+
|
|
|
+ if (options?.EndpointBuilder?.FilterFactories.Count > 0)
|
|
|
+ {
|
|
|
+ filteredInvocation = GeneratedRouteBuilderExtensionsCore.BuildFilterDelegate(ic =>
|
|
|
+ {
|
|
|
+ if (ic.HttpContext.Response.StatusCode == 400)
|
|
|
+ {
|
|
|
+ return ValueTask.FromResult<object?>(Results.Empty);
|
|
|
+ }
|
|
|
+ return ValueTask.FromResult<object?>(handler(ic.GetArgument<global::Microsoft.AspNetCore.Http.HttpContext>(0), ic.GetArgument<global::Microsoft.AspNetCore.Http.Generators.Tests.MyBothBindAsyncStruct>(1)));
|
|
|
+ },
|
|
|
+ options.EndpointBuilder,
|
|
|
+ handler.Method);
|
|
|
+ }
|
|
|
+
|
|
|
+ async Task RequestHandler(HttpContext httpContext)
|
|
|
+ {
|
|
|
+ var wasParamCheckFailure = false;
|
|
|
+ var httpContext_local = httpContext;
|
|
|
+ var myBindAsyncParam_temp = await global::Microsoft.AspNetCore.Http.Generators.Tests.MyBothBindAsyncStruct.BindAsync(httpContext, parameters[1]);
|
|
|
+ global::Microsoft.AspNetCore.Http.Generators.Tests.MyBothBindAsyncStruct myBindAsyncParam_local;
|
|
|
+ if ((object?)myBindAsyncParam_temp == null)
|
|
|
+ {
|
|
|
+ wasParamCheckFailure = true;
|
|
|
+ myBindAsyncParam_local = default!;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ myBindAsyncParam_local = (global::Microsoft.AspNetCore.Http.Generators.Tests.MyBothBindAsyncStruct)myBindAsyncParam_temp;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (wasParamCheckFailure)
|
|
|
+ {
|
|
|
+ httpContext.Response.StatusCode = 400;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ httpContext.Response.ContentType ??= "text/plain";
|
|
|
+ var result = handler(httpContext_local, myBindAsyncParam_local);
|
|
|
+ await httpContext.Response.WriteAsync(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ async Task RequestHandlerFiltered(HttpContext httpContext)
|
|
|
+ {
|
|
|
+ var wasParamCheckFailure = false;
|
|
|
+ var httpContext_local = httpContext;
|
|
|
+ var myBindAsyncParam_temp = await global::Microsoft.AspNetCore.Http.Generators.Tests.MyBothBindAsyncStruct.BindAsync(httpContext, parameters[1]);
|
|
|
+ global::Microsoft.AspNetCore.Http.Generators.Tests.MyBothBindAsyncStruct myBindAsyncParam_local;
|
|
|
+ if ((object?)myBindAsyncParam_temp == null)
|
|
|
+ {
|
|
|
+ wasParamCheckFailure = true;
|
|
|
+ myBindAsyncParam_local = default!;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ myBindAsyncParam_local = (global::Microsoft.AspNetCore.Http.Generators.Tests.MyBothBindAsyncStruct)myBindAsyncParam_temp;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (wasParamCheckFailure)
|
|
|
+ {
|
|
|
+ httpContext.Response.StatusCode = 400;
|
|
|
+ }
|
|
|
+ var result = await filteredInvocation(EndpointFilterInvocationContext.Create<global::Microsoft.AspNetCore.Http.HttpContext, global::Microsoft.AspNetCore.Http.Generators.Tests.MyBothBindAsyncStruct>(httpContext, httpContext_local, myBindAsyncParam_local));
|
|
|
+ await GeneratedRouteBuilderExtensionsCore.ExecuteObjectResult(result, httpContext);
|
|
|
+ }
|
|
|
+
|
|
|
+ RequestDelegate targetDelegate = filteredInvocation is null ? RequestHandler : RequestHandlerFiltered;
|
|
|
+ var metadata = inferredMetadataResult?.EndpointMetadata ?? ReadOnlyCollection<object>.Empty;
|
|
|
+ return new RequestDelegateResult(targetDelegate, metadata);
|
|
|
+ }),
|
|
|
+ [(@"TestMapActions.cs", 31)] = (
|
|
|
+ (methodInfo, options) =>
|
|
|
+ {
|
|
|
+ Debug.Assert(options?.EndpointBuilder != null, "EndpointBuilder not found.");
|
|
|
+ options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 31));
|
|
|
+ return new RequestDelegateMetadataResult { EndpointMetadata = options.EndpointBuilder.Metadata.AsReadOnly() };
|
|
|
+ },
|
|
|
+ (del, options, inferredMetadataResult) =>
|
|
|
+ {
|
|
|
+ var handler = (Func<global::Microsoft.AspNetCore.Http.Generators.Tests.MyBothBindAsyncStruct?, global::System.String>)del;
|
|
|
+ EndpointFilterDelegate? filteredInvocation = null;
|
|
|
+ var parameters = del.Method.GetParameters();
|
|
|
+
|
|
|
+ if (options?.EndpointBuilder?.FilterFactories.Count > 0)
|
|
|
+ {
|
|
|
+ filteredInvocation = GeneratedRouteBuilderExtensionsCore.BuildFilterDelegate(ic =>
|
|
|
+ {
|
|
|
+ if (ic.HttpContext.Response.StatusCode == 400)
|
|
|
+ {
|
|
|
+ return ValueTask.FromResult<object?>(Results.Empty);
|
|
|
+ }
|
|
|
+ return ValueTask.FromResult<object?>(handler(ic.GetArgument<global::Microsoft.AspNetCore.Http.Generators.Tests.MyBothBindAsyncStruct?>(0)));
|
|
|
+ },
|
|
|
+ options.EndpointBuilder,
|
|
|
+ handler.Method);
|
|
|
+ }
|
|
|
+
|
|
|
+ async Task RequestHandler(HttpContext httpContext)
|
|
|
+ {
|
|
|
+ var wasParamCheckFailure = false;
|
|
|
+ var myBindAsyncParam_temp = await global::Microsoft.AspNetCore.Http.Generators.Tests.MyBothBindAsyncStruct.BindAsync(httpContext, parameters[0]);
|
|
|
+ var myBindAsyncParam_local = (global::Microsoft.AspNetCore.Http.Generators.Tests.MyBothBindAsyncStruct?)myBindAsyncParam_temp;
|
|
|
+
|
|
|
+ if (wasParamCheckFailure)
|
|
|
+ {
|
|
|
+ httpContext.Response.StatusCode = 400;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ httpContext.Response.ContentType ??= "text/plain";
|
|
|
+ var result = handler(myBindAsyncParam_local);
|
|
|
+ await httpContext.Response.WriteAsync(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ async Task RequestHandlerFiltered(HttpContext httpContext)
|
|
|
+ {
|
|
|
+ var wasParamCheckFailure = false;
|
|
|
+ var myBindAsyncParam_temp = await global::Microsoft.AspNetCore.Http.Generators.Tests.MyBothBindAsyncStruct.BindAsync(httpContext, parameters[0]);
|
|
|
+ var myBindAsyncParam_local = (global::Microsoft.AspNetCore.Http.Generators.Tests.MyBothBindAsyncStruct?)myBindAsyncParam_temp;
|
|
|
+
|
|
|
+ if (wasParamCheckFailure)
|
|
|
+ {
|
|
|
+ httpContext.Response.StatusCode = 400;
|
|
|
+ }
|
|
|
+ var result = await filteredInvocation(EndpointFilterInvocationContext.Create<global::Microsoft.AspNetCore.Http.Generators.Tests.MyBothBindAsyncStruct?>(httpContext, myBindAsyncParam_local));
|
|
|
+ await GeneratedRouteBuilderExtensionsCore.ExecuteObjectResult(result, httpContext);
|
|
|
+ }
|
|
|
+
|
|
|
+ RequestDelegate targetDelegate = filteredInvocation is null ? RequestHandler : RequestHandlerFiltered;
|
|
|
+ var metadata = inferredMetadataResult?.EndpointMetadata ?? ReadOnlyCollection<object>.Empty;
|
|
|
+ return new RequestDelegateResult(targetDelegate, metadata);
|
|
|
+ }),
|
|
|
+ [(@"TestMapActions.cs", 32)] = (
|
|
|
+ (methodInfo, options) =>
|
|
|
+ {
|
|
|
+ Debug.Assert(options?.EndpointBuilder != null, "EndpointBuilder not found.");
|
|
|
+ options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 32));
|
|
|
+ return new RequestDelegateMetadataResult { EndpointMetadata = options.EndpointBuilder.Metadata.AsReadOnly() };
|
|
|
+ },
|
|
|
+ (del, options, inferredMetadataResult) =>
|
|
|
+ {
|
|
|
+ var handler = (Func<global::Microsoft.AspNetCore.Http.HttpContext, global::Microsoft.AspNetCore.Http.Generators.Tests.MySimpleBindAsyncRecord, global::System.String>)del;
|
|
|
+ EndpointFilterDelegate? filteredInvocation = null;
|
|
|
+
|
|
|
+ if (options?.EndpointBuilder?.FilterFactories.Count > 0)
|
|
|
+ {
|
|
|
+ filteredInvocation = GeneratedRouteBuilderExtensionsCore.BuildFilterDelegate(ic =>
|
|
|
+ {
|
|
|
+ if (ic.HttpContext.Response.StatusCode == 400)
|
|
|
+ {
|
|
|
+ return ValueTask.FromResult<object?>(Results.Empty);
|
|
|
+ }
|
|
|
+ return ValueTask.FromResult<object?>(handler(ic.GetArgument<global::Microsoft.AspNetCore.Http.HttpContext>(0), ic.GetArgument<global::Microsoft.AspNetCore.Http.Generators.Tests.MySimpleBindAsyncRecord>(1)));
|
|
|
+ },
|
|
|
+ options.EndpointBuilder,
|
|
|
+ handler.Method);
|
|
|
+ }
|
|
|
+
|
|
|
+ async Task RequestHandler(HttpContext httpContext)
|
|
|
+ {
|
|
|
+ var wasParamCheckFailure = false;
|
|
|
+ var httpContext_local = httpContext;
|
|
|
+ var myBindAsyncParam_temp = await global::Microsoft.AspNetCore.Http.Generators.Tests.MySimpleBindAsyncRecord.BindAsync(httpContext);
|
|
|
+ global::Microsoft.AspNetCore.Http.Generators.Tests.MySimpleBindAsyncRecord myBindAsyncParam_local;
|
|
|
+ if ((object?)myBindAsyncParam_temp == null)
|
|
|
+ {
|
|
|
+ wasParamCheckFailure = true;
|
|
|
+ myBindAsyncParam_local = default!;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ myBindAsyncParam_local = (global::Microsoft.AspNetCore.Http.Generators.Tests.MySimpleBindAsyncRecord)myBindAsyncParam_temp;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (wasParamCheckFailure)
|
|
|
+ {
|
|
|
+ httpContext.Response.StatusCode = 400;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ httpContext.Response.ContentType ??= "text/plain";
|
|
|
+ var result = handler(httpContext_local, myBindAsyncParam_local);
|
|
|
+ await httpContext.Response.WriteAsync(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ async Task RequestHandlerFiltered(HttpContext httpContext)
|
|
|
+ {
|
|
|
+ var wasParamCheckFailure = false;
|
|
|
+ var httpContext_local = httpContext;
|
|
|
+ var myBindAsyncParam_temp = await global::Microsoft.AspNetCore.Http.Generators.Tests.MySimpleBindAsyncRecord.BindAsync(httpContext);
|
|
|
+ global::Microsoft.AspNetCore.Http.Generators.Tests.MySimpleBindAsyncRecord myBindAsyncParam_local;
|
|
|
+ if ((object?)myBindAsyncParam_temp == null)
|
|
|
+ {
|
|
|
+ wasParamCheckFailure = true;
|
|
|
+ myBindAsyncParam_local = default!;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ myBindAsyncParam_local = (global::Microsoft.AspNetCore.Http.Generators.Tests.MySimpleBindAsyncRecord)myBindAsyncParam_temp;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (wasParamCheckFailure)
|
|
|
+ {
|
|
|
+ httpContext.Response.StatusCode = 400;
|
|
|
+ }
|
|
|
+ var result = await filteredInvocation(EndpointFilterInvocationContext.Create<global::Microsoft.AspNetCore.Http.HttpContext, global::Microsoft.AspNetCore.Http.Generators.Tests.MySimpleBindAsyncRecord>(httpContext, httpContext_local, myBindAsyncParam_local));
|
|
|
+ await GeneratedRouteBuilderExtensionsCore.ExecuteObjectResult(result, httpContext);
|
|
|
+ }
|
|
|
+
|
|
|
+ RequestDelegate targetDelegate = filteredInvocation is null ? RequestHandler : RequestHandlerFiltered;
|
|
|
+ var metadata = inferredMetadataResult?.EndpointMetadata ?? ReadOnlyCollection<object>.Empty;
|
|
|
+ return new RequestDelegateResult(targetDelegate, metadata);
|
|
|
+ }),
|
|
|
+ [(@"TestMapActions.cs", 33)] = (
|
|
|
+ (methodInfo, options) =>
|
|
|
+ {
|
|
|
+ Debug.Assert(options?.EndpointBuilder != null, "EndpointBuilder not found.");
|
|
|
+ options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 33));
|
|
|
+ return new RequestDelegateMetadataResult { EndpointMetadata = options.EndpointBuilder.Metadata.AsReadOnly() };
|
|
|
+ },
|
|
|
+ (del, options, inferredMetadataResult) =>
|
|
|
+ {
|
|
|
+ var handler = (Func<global::Microsoft.AspNetCore.Http.Generators.Tests.MySimpleBindAsyncRecord?, global::System.String>)del;
|
|
|
+ EndpointFilterDelegate? filteredInvocation = null;
|
|
|
+
|
|
|
+ if (options?.EndpointBuilder?.FilterFactories.Count > 0)
|
|
|
+ {
|
|
|
+ filteredInvocation = GeneratedRouteBuilderExtensionsCore.BuildFilterDelegate(ic =>
|
|
|
+ {
|
|
|
+ if (ic.HttpContext.Response.StatusCode == 400)
|
|
|
+ {
|
|
|
+ return ValueTask.FromResult<object?>(Results.Empty);
|
|
|
+ }
|
|
|
+ return ValueTask.FromResult<object?>(handler(ic.GetArgument<global::Microsoft.AspNetCore.Http.Generators.Tests.MySimpleBindAsyncRecord?>(0)));
|
|
|
+ },
|
|
|
+ options.EndpointBuilder,
|
|
|
+ handler.Method);
|
|
|
+ }
|
|
|
+
|
|
|
+ async Task RequestHandler(HttpContext httpContext)
|
|
|
+ {
|
|
|
+ var wasParamCheckFailure = false;
|
|
|
+ var myBindAsyncParam_temp = await global::Microsoft.AspNetCore.Http.Generators.Tests.MySimpleBindAsyncRecord.BindAsync(httpContext);
|
|
|
+ var myBindAsyncParam_local = (global::Microsoft.AspNetCore.Http.Generators.Tests.MySimpleBindAsyncRecord?)myBindAsyncParam_temp;
|
|
|
+
|
|
|
+ if (wasParamCheckFailure)
|
|
|
+ {
|
|
|
+ httpContext.Response.StatusCode = 400;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ httpContext.Response.ContentType ??= "text/plain";
|
|
|
+ var result = handler(myBindAsyncParam_local);
|
|
|
+ await httpContext.Response.WriteAsync(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ async Task RequestHandlerFiltered(HttpContext httpContext)
|
|
|
+ {
|
|
|
+ var wasParamCheckFailure = false;
|
|
|
+ var myBindAsyncParam_temp = await global::Microsoft.AspNetCore.Http.Generators.Tests.MySimpleBindAsyncRecord.BindAsync(httpContext);
|
|
|
+ var myBindAsyncParam_local = (global::Microsoft.AspNetCore.Http.Generators.Tests.MySimpleBindAsyncRecord?)myBindAsyncParam_temp;
|
|
|
+
|
|
|
+ if (wasParamCheckFailure)
|
|
|
+ {
|
|
|
+ httpContext.Response.StatusCode = 400;
|
|
|
+ }
|
|
|
+ var result = await filteredInvocation(EndpointFilterInvocationContext.Create<global::Microsoft.AspNetCore.Http.Generators.Tests.MySimpleBindAsyncRecord?>(httpContext, myBindAsyncParam_local));
|
|
|
+ await GeneratedRouteBuilderExtensionsCore.ExecuteObjectResult(result, httpContext);
|
|
|
+ }
|
|
|
+
|
|
|
+ RequestDelegate targetDelegate = filteredInvocation is null ? RequestHandler : RequestHandlerFiltered;
|
|
|
+ var metadata = inferredMetadataResult?.EndpointMetadata ?? ReadOnlyCollection<object>.Empty;
|
|
|
+ return new RequestDelegateResult(targetDelegate, metadata);
|
|
|
+ }),
|
|
|
+ [(@"TestMapActions.cs", 34)] = (
|
|
|
+ (methodInfo, options) =>
|
|
|
+ {
|
|
|
+ Debug.Assert(options?.EndpointBuilder != null, "EndpointBuilder not found.");
|
|
|
+ options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 34));
|
|
|
+ return new RequestDelegateMetadataResult { EndpointMetadata = options.EndpointBuilder.Metadata.AsReadOnly() };
|
|
|
+ },
|
|
|
+ (del, options, inferredMetadataResult) =>
|
|
|
+ {
|
|
|
+ var handler = (Func<global::Microsoft.AspNetCore.Http.HttpContext, global::Microsoft.AspNetCore.Http.Generators.Tests.MySimpleBindAsyncStruct, global::System.String>)del;
|
|
|
+ EndpointFilterDelegate? filteredInvocation = null;
|
|
|
+
|
|
|
+ if (options?.EndpointBuilder?.FilterFactories.Count > 0)
|
|
|
+ {
|
|
|
+ filteredInvocation = GeneratedRouteBuilderExtensionsCore.BuildFilterDelegate(ic =>
|
|
|
+ {
|
|
|
+ if (ic.HttpContext.Response.StatusCode == 400)
|
|
|
+ {
|
|
|
+ return ValueTask.FromResult<object?>(Results.Empty);
|
|
|
+ }
|
|
|
+ return ValueTask.FromResult<object?>(handler(ic.GetArgument<global::Microsoft.AspNetCore.Http.HttpContext>(0), ic.GetArgument<global::Microsoft.AspNetCore.Http.Generators.Tests.MySimpleBindAsyncStruct>(1)));
|
|
|
+ },
|
|
|
+ options.EndpointBuilder,
|
|
|
+ handler.Method);
|
|
|
+ }
|
|
|
+
|
|
|
+ async Task RequestHandler(HttpContext httpContext)
|
|
|
+ {
|
|
|
+ var wasParamCheckFailure = false;
|
|
|
+ var httpContext_local = httpContext;
|
|
|
+ var myBindAsyncParam_temp = await global::Microsoft.AspNetCore.Http.Generators.Tests.MySimpleBindAsyncStruct.BindAsync(httpContext);
|
|
|
+ global::Microsoft.AspNetCore.Http.Generators.Tests.MySimpleBindAsyncStruct myBindAsyncParam_local;
|
|
|
+ if ((object?)myBindAsyncParam_temp == null)
|
|
|
+ {
|
|
|
+ wasParamCheckFailure = true;
|
|
|
+ myBindAsyncParam_local = default!;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ myBindAsyncParam_local = (global::Microsoft.AspNetCore.Http.Generators.Tests.MySimpleBindAsyncStruct)myBindAsyncParam_temp;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (wasParamCheckFailure)
|
|
|
+ {
|
|
|
+ httpContext.Response.StatusCode = 400;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ httpContext.Response.ContentType ??= "text/plain";
|
|
|
+ var result = handler(httpContext_local, myBindAsyncParam_local);
|
|
|
+ await httpContext.Response.WriteAsync(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ async Task RequestHandlerFiltered(HttpContext httpContext)
|
|
|
+ {
|
|
|
+ var wasParamCheckFailure = false;
|
|
|
+ var httpContext_local = httpContext;
|
|
|
+ var myBindAsyncParam_temp = await global::Microsoft.AspNetCore.Http.Generators.Tests.MySimpleBindAsyncStruct.BindAsync(httpContext);
|
|
|
+ global::Microsoft.AspNetCore.Http.Generators.Tests.MySimpleBindAsyncStruct myBindAsyncParam_local;
|
|
|
+ if ((object?)myBindAsyncParam_temp == null)
|
|
|
+ {
|
|
|
+ wasParamCheckFailure = true;
|
|
|
+ myBindAsyncParam_local = default!;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ myBindAsyncParam_local = (global::Microsoft.AspNetCore.Http.Generators.Tests.MySimpleBindAsyncStruct)myBindAsyncParam_temp;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (wasParamCheckFailure)
|
|
|
+ {
|
|
|
+ httpContext.Response.StatusCode = 400;
|
|
|
+ }
|
|
|
+ var result = await filteredInvocation(EndpointFilterInvocationContext.Create<global::Microsoft.AspNetCore.Http.HttpContext, global::Microsoft.AspNetCore.Http.Generators.Tests.MySimpleBindAsyncStruct>(httpContext, httpContext_local, myBindAsyncParam_local));
|
|
|
+ await GeneratedRouteBuilderExtensionsCore.ExecuteObjectResult(result, httpContext);
|
|
|
+ }
|
|
|
+
|
|
|
+ RequestDelegate targetDelegate = filteredInvocation is null ? RequestHandler : RequestHandlerFiltered;
|
|
|
+ var metadata = inferredMetadataResult?.EndpointMetadata ?? ReadOnlyCollection<object>.Empty;
|
|
|
+ return new RequestDelegateResult(targetDelegate, metadata);
|
|
|
+ }),
|
|
|
+ [(@"TestMapActions.cs", 35)] = (
|
|
|
+ (methodInfo, options) =>
|
|
|
+ {
|
|
|
+ Debug.Assert(options?.EndpointBuilder != null, "EndpointBuilder not found.");
|
|
|
+ options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 35));
|
|
|
+ return new RequestDelegateMetadataResult { EndpointMetadata = options.EndpointBuilder.Metadata.AsReadOnly() };
|
|
|
+ },
|
|
|
+ (del, options, inferredMetadataResult) =>
|
|
|
+ {
|
|
|
+ var handler = (Func<global::Microsoft.AspNetCore.Http.Generators.Tests.MySimpleBindAsyncStruct?, global::System.String>)del;
|
|
|
+ EndpointFilterDelegate? filteredInvocation = null;
|
|
|
+
|
|
|
+ if (options?.EndpointBuilder?.FilterFactories.Count > 0)
|
|
|
+ {
|
|
|
+ filteredInvocation = GeneratedRouteBuilderExtensionsCore.BuildFilterDelegate(ic =>
|
|
|
+ {
|
|
|
+ if (ic.HttpContext.Response.StatusCode == 400)
|
|
|
+ {
|
|
|
+ return ValueTask.FromResult<object?>(Results.Empty);
|
|
|
+ }
|
|
|
+ return ValueTask.FromResult<object?>(handler(ic.GetArgument<global::Microsoft.AspNetCore.Http.Generators.Tests.MySimpleBindAsyncStruct?>(0)));
|
|
|
+ },
|
|
|
+ options.EndpointBuilder,
|
|
|
+ handler.Method);
|
|
|
+ }
|
|
|
+
|
|
|
+ async Task RequestHandler(HttpContext httpContext)
|
|
|
+ {
|
|
|
+ var wasParamCheckFailure = false;
|
|
|
+ var myBindAsyncParam_temp = await global::Microsoft.AspNetCore.Http.Generators.Tests.MySimpleBindAsyncStruct.BindAsync(httpContext);
|
|
|
+ var myBindAsyncParam_local = (global::Microsoft.AspNetCore.Http.Generators.Tests.MySimpleBindAsyncStruct?)myBindAsyncParam_temp;
|
|
|
+
|
|
|
+ if (wasParamCheckFailure)
|
|
|
+ {
|
|
|
+ httpContext.Response.StatusCode = 400;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ httpContext.Response.ContentType ??= "text/plain";
|
|
|
+ var result = handler(myBindAsyncParam_local);
|
|
|
+ await httpContext.Response.WriteAsync(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ async Task RequestHandlerFiltered(HttpContext httpContext)
|
|
|
+ {
|
|
|
+ var wasParamCheckFailure = false;
|
|
|
+ var myBindAsyncParam_temp = await global::Microsoft.AspNetCore.Http.Generators.Tests.MySimpleBindAsyncStruct.BindAsync(httpContext);
|
|
|
+ var myBindAsyncParam_local = (global::Microsoft.AspNetCore.Http.Generators.Tests.MySimpleBindAsyncStruct?)myBindAsyncParam_temp;
|
|
|
+
|
|
|
+ if (wasParamCheckFailure)
|
|
|
+ {
|
|
|
+ httpContext.Response.StatusCode = 400;
|
|
|
+ }
|
|
|
+ var result = await filteredInvocation(EndpointFilterInvocationContext.Create<global::Microsoft.AspNetCore.Http.Generators.Tests.MySimpleBindAsyncStruct?>(httpContext, myBindAsyncParam_local));
|
|
|
+ await GeneratedRouteBuilderExtensionsCore.ExecuteObjectResult(result, httpContext);
|
|
|
+ }
|
|
|
+
|
|
|
+ RequestDelegate targetDelegate = filteredInvocation is null ? RequestHandler : RequestHandlerFiltered;
|
|
|
+ var metadata = inferredMetadataResult?.EndpointMetadata ?? ReadOnlyCollection<object>.Empty;
|
|
|
+ return new RequestDelegateResult(targetDelegate, metadata);
|
|
|
+ }),
|
|
|
+ [(@"TestMapActions.cs", 36)] = (
|
|
|
+ (methodInfo, options) =>
|
|
|
+ {
|
|
|
+ Debug.Assert(options?.EndpointBuilder != null, "EndpointBuilder not found.");
|
|
|
+ options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 36));
|
|
|
+ return new RequestDelegateMetadataResult { EndpointMetadata = options.EndpointBuilder.Metadata.AsReadOnly() };
|
|
|
+ },
|
|
|
+ (del, options, inferredMetadataResult) =>
|
|
|
+ {
|
|
|
+ var handler = (Func<global::Microsoft.AspNetCore.Http.HttpContext, global::Microsoft.AspNetCore.Http.Generators.Tests.BindAsyncFromImplicitStaticAbstractInterface, global::System.String>)del;
|
|
|
+ EndpointFilterDelegate? filteredInvocation = null;
|
|
|
+ var parameters = del.Method.GetParameters();
|
|
|
+
|
|
|
+ if (options?.EndpointBuilder?.FilterFactories.Count > 0)
|
|
|
+ {
|
|
|
+ filteredInvocation = GeneratedRouteBuilderExtensionsCore.BuildFilterDelegate(ic =>
|
|
|
+ {
|
|
|
+ if (ic.HttpContext.Response.StatusCode == 400)
|
|
|
+ {
|
|
|
+ return ValueTask.FromResult<object?>(Results.Empty);
|
|
|
+ }
|
|
|
+ return ValueTask.FromResult<object?>(handler(ic.GetArgument<global::Microsoft.AspNetCore.Http.HttpContext>(0), ic.GetArgument<global::Microsoft.AspNetCore.Http.Generators.Tests.BindAsyncFromImplicitStaticAbstractInterface>(1)));
|
|
|
+ },
|
|
|
+ options.EndpointBuilder,
|
|
|
+ handler.Method);
|
|
|
+ }
|
|
|
+
|
|
|
+ async Task RequestHandler(HttpContext httpContext)
|
|
|
+ {
|
|
|
+ var wasParamCheckFailure = false;
|
|
|
+ var httpContext_local = httpContext;
|
|
|
+ var myBindAsyncParam_temp = await BindAsync<global::Microsoft.AspNetCore.Http.Generators.Tests.BindAsyncFromImplicitStaticAbstractInterface>(httpContext, parameters[1]);
|
|
|
+ global::Microsoft.AspNetCore.Http.Generators.Tests.BindAsyncFromImplicitStaticAbstractInterface myBindAsyncParam_local;
|
|
|
+ if ((object?)myBindAsyncParam_temp == null)
|
|
|
+ {
|
|
|
+ wasParamCheckFailure = true;
|
|
|
+ myBindAsyncParam_local = default!;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ myBindAsyncParam_local = (global::Microsoft.AspNetCore.Http.Generators.Tests.BindAsyncFromImplicitStaticAbstractInterface)myBindAsyncParam_temp;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (wasParamCheckFailure)
|
|
|
+ {
|
|
|
+ httpContext.Response.StatusCode = 400;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ httpContext.Response.ContentType ??= "text/plain";
|
|
|
+ var result = handler(httpContext_local, myBindAsyncParam_local);
|
|
|
+ await httpContext.Response.WriteAsync(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ async Task RequestHandlerFiltered(HttpContext httpContext)
|
|
|
+ {
|
|
|
+ var wasParamCheckFailure = false;
|
|
|
+ var httpContext_local = httpContext;
|
|
|
+ var myBindAsyncParam_temp = await BindAsync<global::Microsoft.AspNetCore.Http.Generators.Tests.BindAsyncFromImplicitStaticAbstractInterface>(httpContext, parameters[1]);
|
|
|
+ global::Microsoft.AspNetCore.Http.Generators.Tests.BindAsyncFromImplicitStaticAbstractInterface myBindAsyncParam_local;
|
|
|
+ if ((object?)myBindAsyncParam_temp == null)
|
|
|
+ {
|
|
|
+ wasParamCheckFailure = true;
|
|
|
+ myBindAsyncParam_local = default!;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ myBindAsyncParam_local = (global::Microsoft.AspNetCore.Http.Generators.Tests.BindAsyncFromImplicitStaticAbstractInterface)myBindAsyncParam_temp;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (wasParamCheckFailure)
|
|
|
+ {
|
|
|
+ httpContext.Response.StatusCode = 400;
|
|
|
+ }
|
|
|
+ var result = await filteredInvocation(EndpointFilterInvocationContext.Create<global::Microsoft.AspNetCore.Http.HttpContext, global::Microsoft.AspNetCore.Http.Generators.Tests.BindAsyncFromImplicitStaticAbstractInterface>(httpContext, httpContext_local, myBindAsyncParam_local));
|
|
|
+ await GeneratedRouteBuilderExtensionsCore.ExecuteObjectResult(result, httpContext);
|
|
|
+ }
|
|
|
+
|
|
|
+ RequestDelegate targetDelegate = filteredInvocation is null ? RequestHandler : RequestHandlerFiltered;
|
|
|
+ var metadata = inferredMetadataResult?.EndpointMetadata ?? ReadOnlyCollection<object>.Empty;
|
|
|
+ return new RequestDelegateResult(targetDelegate, metadata);
|
|
|
+ }),
|
|
|
+ [(@"TestMapActions.cs", 37)] = (
|
|
|
+ (methodInfo, options) =>
|
|
|
+ {
|
|
|
+ Debug.Assert(options?.EndpointBuilder != null, "EndpointBuilder not found.");
|
|
|
+ options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 37));
|
|
|
+ return new RequestDelegateMetadataResult { EndpointMetadata = options.EndpointBuilder.Metadata.AsReadOnly() };
|
|
|
+ },
|
|
|
+ (del, options, inferredMetadataResult) =>
|
|
|
+ {
|
|
|
+ var handler = (Func<global::Microsoft.AspNetCore.Http.Generators.Tests.BindAsyncFromImplicitStaticAbstractInterface?, global::System.String>)del;
|
|
|
+ EndpointFilterDelegate? filteredInvocation = null;
|
|
|
+ var parameters = del.Method.GetParameters();
|
|
|
+
|
|
|
+ if (options?.EndpointBuilder?.FilterFactories.Count > 0)
|
|
|
+ {
|
|
|
+ filteredInvocation = GeneratedRouteBuilderExtensionsCore.BuildFilterDelegate(ic =>
|
|
|
+ {
|
|
|
+ if (ic.HttpContext.Response.StatusCode == 400)
|
|
|
+ {
|
|
|
+ return ValueTask.FromResult<object?>(Results.Empty);
|
|
|
+ }
|
|
|
+ return ValueTask.FromResult<object?>(handler(ic.GetArgument<global::Microsoft.AspNetCore.Http.Generators.Tests.BindAsyncFromImplicitStaticAbstractInterface?>(0)));
|
|
|
+ },
|
|
|
+ options.EndpointBuilder,
|
|
|
+ handler.Method);
|
|
|
+ }
|
|
|
+
|
|
|
+ async Task RequestHandler(HttpContext httpContext)
|
|
|
+ {
|
|
|
+ var wasParamCheckFailure = false;
|
|
|
+ var myBindAsyncParam_temp = await BindAsync<global::Microsoft.AspNetCore.Http.Generators.Tests.BindAsyncFromImplicitStaticAbstractInterface>(httpContext, parameters[0]);
|
|
|
+ var myBindAsyncParam_local = (global::Microsoft.AspNetCore.Http.Generators.Tests.BindAsyncFromImplicitStaticAbstractInterface?)myBindAsyncParam_temp;
|
|
|
+
|
|
|
+ if (wasParamCheckFailure)
|
|
|
+ {
|
|
|
+ httpContext.Response.StatusCode = 400;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ httpContext.Response.ContentType ??= "text/plain";
|
|
|
+ var result = handler(myBindAsyncParam_local);
|
|
|
+ await httpContext.Response.WriteAsync(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ async Task RequestHandlerFiltered(HttpContext httpContext)
|
|
|
+ {
|
|
|
+ var wasParamCheckFailure = false;
|
|
|
+ var myBindAsyncParam_temp = await BindAsync<global::Microsoft.AspNetCore.Http.Generators.Tests.BindAsyncFromImplicitStaticAbstractInterface>(httpContext, parameters[0]);
|
|
|
+ var myBindAsyncParam_local = (global::Microsoft.AspNetCore.Http.Generators.Tests.BindAsyncFromImplicitStaticAbstractInterface?)myBindAsyncParam_temp;
|
|
|
+
|
|
|
+ if (wasParamCheckFailure)
|
|
|
+ {
|
|
|
+ httpContext.Response.StatusCode = 400;
|
|
|
+ }
|
|
|
+ var result = await filteredInvocation(EndpointFilterInvocationContext.Create<global::Microsoft.AspNetCore.Http.Generators.Tests.BindAsyncFromImplicitStaticAbstractInterface?>(httpContext, myBindAsyncParam_local));
|
|
|
+ await GeneratedRouteBuilderExtensionsCore.ExecuteObjectResult(result, httpContext);
|
|
|
+ }
|
|
|
+
|
|
|
+ RequestDelegate targetDelegate = filteredInvocation is null ? RequestHandler : RequestHandlerFiltered;
|
|
|
+ var metadata = inferredMetadataResult?.EndpointMetadata ?? ReadOnlyCollection<object>.Empty;
|
|
|
+ return new RequestDelegateResult(targetDelegate, metadata);
|
|
|
+ }),
|
|
|
+ [(@"TestMapActions.cs", 38)] = (
|
|
|
+ (methodInfo, options) =>
|
|
|
+ {
|
|
|
+ Debug.Assert(options?.EndpointBuilder != null, "EndpointBuilder not found.");
|
|
|
+ options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 38));
|
|
|
+ return new RequestDelegateMetadataResult { EndpointMetadata = options.EndpointBuilder.Metadata.AsReadOnly() };
|
|
|
+ },
|
|
|
+ (del, options, inferredMetadataResult) =>
|
|
|
+ {
|
|
|
+ var handler = (Func<global::Microsoft.AspNetCore.Http.HttpContext, global::Microsoft.AspNetCore.Http.Generators.Tests.InheritBindAsync, global::System.String>)del;
|
|
|
+ EndpointFilterDelegate? filteredInvocation = null;
|
|
|
+
|
|
|
+ if (options?.EndpointBuilder?.FilterFactories.Count > 0)
|
|
|
+ {
|
|
|
+ filteredInvocation = GeneratedRouteBuilderExtensionsCore.BuildFilterDelegate(ic =>
|
|
|
+ {
|
|
|
+ if (ic.HttpContext.Response.StatusCode == 400)
|
|
|
+ {
|
|
|
+ return ValueTask.FromResult<object?>(Results.Empty);
|
|
|
+ }
|
|
|
+ return ValueTask.FromResult<object?>(handler(ic.GetArgument<global::Microsoft.AspNetCore.Http.HttpContext>(0), ic.GetArgument<global::Microsoft.AspNetCore.Http.Generators.Tests.InheritBindAsync>(1)));
|
|
|
+ },
|
|
|
+ options.EndpointBuilder,
|
|
|
+ handler.Method);
|
|
|
+ }
|
|
|
+
|
|
|
+ async Task RequestHandler(HttpContext httpContext)
|
|
|
+ {
|
|
|
+ var wasParamCheckFailure = false;
|
|
|
+ var httpContext_local = httpContext;
|
|
|
+ var myBindAsyncParam_temp = await global::Microsoft.AspNetCore.Http.Generators.Tests.InheritBindAsync.BindAsync(httpContext);
|
|
|
+ global::Microsoft.AspNetCore.Http.Generators.Tests.InheritBindAsync myBindAsyncParam_local;
|
|
|
+ if ((object?)myBindAsyncParam_temp == null)
|
|
|
+ {
|
|
|
+ wasParamCheckFailure = true;
|
|
|
+ myBindAsyncParam_local = default!;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ myBindAsyncParam_local = (global::Microsoft.AspNetCore.Http.Generators.Tests.InheritBindAsync)myBindAsyncParam_temp;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (wasParamCheckFailure)
|
|
|
+ {
|
|
|
+ httpContext.Response.StatusCode = 400;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ httpContext.Response.ContentType ??= "text/plain";
|
|
|
+ var result = handler(httpContext_local, myBindAsyncParam_local);
|
|
|
+ await httpContext.Response.WriteAsync(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ async Task RequestHandlerFiltered(HttpContext httpContext)
|
|
|
+ {
|
|
|
+ var wasParamCheckFailure = false;
|
|
|
+ var httpContext_local = httpContext;
|
|
|
+ var myBindAsyncParam_temp = await global::Microsoft.AspNetCore.Http.Generators.Tests.InheritBindAsync.BindAsync(httpContext);
|
|
|
+ global::Microsoft.AspNetCore.Http.Generators.Tests.InheritBindAsync myBindAsyncParam_local;
|
|
|
+ if ((object?)myBindAsyncParam_temp == null)
|
|
|
+ {
|
|
|
+ wasParamCheckFailure = true;
|
|
|
+ myBindAsyncParam_local = default!;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ myBindAsyncParam_local = (global::Microsoft.AspNetCore.Http.Generators.Tests.InheritBindAsync)myBindAsyncParam_temp;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (wasParamCheckFailure)
|
|
|
+ {
|
|
|
+ httpContext.Response.StatusCode = 400;
|
|
|
+ }
|
|
|
+ var result = await filteredInvocation(EndpointFilterInvocationContext.Create<global::Microsoft.AspNetCore.Http.HttpContext, global::Microsoft.AspNetCore.Http.Generators.Tests.InheritBindAsync>(httpContext, httpContext_local, myBindAsyncParam_local));
|
|
|
+ await GeneratedRouteBuilderExtensionsCore.ExecuteObjectResult(result, httpContext);
|
|
|
+ }
|
|
|
+
|
|
|
+ RequestDelegate targetDelegate = filteredInvocation is null ? RequestHandler : RequestHandlerFiltered;
|
|
|
+ var metadata = inferredMetadataResult?.EndpointMetadata ?? ReadOnlyCollection<object>.Empty;
|
|
|
+ return new RequestDelegateResult(targetDelegate, metadata);
|
|
|
+ }),
|
|
|
+ [(@"TestMapActions.cs", 39)] = (
|
|
|
+ (methodInfo, options) =>
|
|
|
+ {
|
|
|
+ Debug.Assert(options?.EndpointBuilder != null, "EndpointBuilder not found.");
|
|
|
+ options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 39));
|
|
|
+ return new RequestDelegateMetadataResult { EndpointMetadata = options.EndpointBuilder.Metadata.AsReadOnly() };
|
|
|
+ },
|
|
|
+ (del, options, inferredMetadataResult) =>
|
|
|
+ {
|
|
|
+ var handler = (Func<global::Microsoft.AspNetCore.Http.Generators.Tests.InheritBindAsync?, global::System.String>)del;
|
|
|
+ EndpointFilterDelegate? filteredInvocation = null;
|
|
|
+
|
|
|
+ if (options?.EndpointBuilder?.FilterFactories.Count > 0)
|
|
|
+ {
|
|
|
+ filteredInvocation = GeneratedRouteBuilderExtensionsCore.BuildFilterDelegate(ic =>
|
|
|
+ {
|
|
|
+ if (ic.HttpContext.Response.StatusCode == 400)
|
|
|
+ {
|
|
|
+ return ValueTask.FromResult<object?>(Results.Empty);
|
|
|
+ }
|
|
|
+ return ValueTask.FromResult<object?>(handler(ic.GetArgument<global::Microsoft.AspNetCore.Http.Generators.Tests.InheritBindAsync?>(0)));
|
|
|
+ },
|
|
|
+ options.EndpointBuilder,
|
|
|
+ handler.Method);
|
|
|
+ }
|
|
|
+
|
|
|
+ async Task RequestHandler(HttpContext httpContext)
|
|
|
+ {
|
|
|
+ var wasParamCheckFailure = false;
|
|
|
+ var myBindAsyncParam_temp = await global::Microsoft.AspNetCore.Http.Generators.Tests.InheritBindAsync.BindAsync(httpContext);
|
|
|
+ var myBindAsyncParam_local = (global::Microsoft.AspNetCore.Http.Generators.Tests.InheritBindAsync?)myBindAsyncParam_temp;
|
|
|
+
|
|
|
+ if (wasParamCheckFailure)
|
|
|
+ {
|
|
|
+ httpContext.Response.StatusCode = 400;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ httpContext.Response.ContentType ??= "text/plain";
|
|
|
+ var result = handler(myBindAsyncParam_local);
|
|
|
+ await httpContext.Response.WriteAsync(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ async Task RequestHandlerFiltered(HttpContext httpContext)
|
|
|
+ {
|
|
|
+ var wasParamCheckFailure = false;
|
|
|
+ var myBindAsyncParam_temp = await global::Microsoft.AspNetCore.Http.Generators.Tests.InheritBindAsync.BindAsync(httpContext);
|
|
|
+ var myBindAsyncParam_local = (global::Microsoft.AspNetCore.Http.Generators.Tests.InheritBindAsync?)myBindAsyncParam_temp;
|
|
|
+
|
|
|
+ if (wasParamCheckFailure)
|
|
|
+ {
|
|
|
+ httpContext.Response.StatusCode = 400;
|
|
|
+ }
|
|
|
+ var result = await filteredInvocation(EndpointFilterInvocationContext.Create<global::Microsoft.AspNetCore.Http.Generators.Tests.InheritBindAsync?>(httpContext, myBindAsyncParam_local));
|
|
|
+ await GeneratedRouteBuilderExtensionsCore.ExecuteObjectResult(result, httpContext);
|
|
|
+ }
|
|
|
+
|
|
|
+ RequestDelegate targetDelegate = filteredInvocation is null ? RequestHandler : RequestHandlerFiltered;
|
|
|
+ var metadata = inferredMetadataResult?.EndpointMetadata ?? ReadOnlyCollection<object>.Empty;
|
|
|
+ return new RequestDelegateResult(targetDelegate, metadata);
|
|
|
+ }),
|
|
|
+ [(@"TestMapActions.cs", 40)] = (
|
|
|
+ (methodInfo, options) =>
|
|
|
+ {
|
|
|
+ Debug.Assert(options?.EndpointBuilder != null, "EndpointBuilder not found.");
|
|
|
+ options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 40));
|
|
|
+ return new RequestDelegateMetadataResult { EndpointMetadata = options.EndpointBuilder.Metadata.AsReadOnly() };
|
|
|
+ },
|
|
|
+ (del, options, inferredMetadataResult) =>
|
|
|
+ {
|
|
|
+ var handler = (Func<global::Microsoft.AspNetCore.Http.HttpContext, global::Microsoft.AspNetCore.Http.Generators.Tests.BindAsyncFromExplicitStaticAbstractInterface, global::System.String>)del;
|
|
|
+ EndpointFilterDelegate? filteredInvocation = null;
|
|
|
+ var parameters = del.Method.GetParameters();
|
|
|
+
|
|
|
+ if (options?.EndpointBuilder?.FilterFactories.Count > 0)
|
|
|
+ {
|
|
|
+ filteredInvocation = GeneratedRouteBuilderExtensionsCore.BuildFilterDelegate(ic =>
|
|
|
+ {
|
|
|
+ if (ic.HttpContext.Response.StatusCode == 400)
|
|
|
+ {
|
|
|
+ return ValueTask.FromResult<object?>(Results.Empty);
|
|
|
+ }
|
|
|
+ return ValueTask.FromResult<object?>(handler(ic.GetArgument<global::Microsoft.AspNetCore.Http.HttpContext>(0), ic.GetArgument<global::Microsoft.AspNetCore.Http.Generators.Tests.BindAsyncFromExplicitStaticAbstractInterface>(1)));
|
|
|
+ },
|
|
|
+ options.EndpointBuilder,
|
|
|
+ handler.Method);
|
|
|
+ }
|
|
|
+
|
|
|
+ async Task RequestHandler(HttpContext httpContext)
|
|
|
+ {
|
|
|
+ var wasParamCheckFailure = false;
|
|
|
+ var httpContext_local = httpContext;
|
|
|
+ var myBindAsyncParam_temp = await BindAsync<global::Microsoft.AspNetCore.Http.Generators.Tests.BindAsyncFromExplicitStaticAbstractInterface>(httpContext, parameters[1]);
|
|
|
+ global::Microsoft.AspNetCore.Http.Generators.Tests.BindAsyncFromExplicitStaticAbstractInterface myBindAsyncParam_local;
|
|
|
+ if ((object?)myBindAsyncParam_temp == null)
|
|
|
+ {
|
|
|
+ wasParamCheckFailure = true;
|
|
|
+ myBindAsyncParam_local = default!;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ myBindAsyncParam_local = (global::Microsoft.AspNetCore.Http.Generators.Tests.BindAsyncFromExplicitStaticAbstractInterface)myBindAsyncParam_temp;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (wasParamCheckFailure)
|
|
|
+ {
|
|
|
+ httpContext.Response.StatusCode = 400;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ httpContext.Response.ContentType ??= "text/plain";
|
|
|
+ var result = handler(httpContext_local, myBindAsyncParam_local);
|
|
|
+ await httpContext.Response.WriteAsync(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ async Task RequestHandlerFiltered(HttpContext httpContext)
|
|
|
+ {
|
|
|
+ var wasParamCheckFailure = false;
|
|
|
+ var httpContext_local = httpContext;
|
|
|
+ var myBindAsyncParam_temp = await BindAsync<global::Microsoft.AspNetCore.Http.Generators.Tests.BindAsyncFromExplicitStaticAbstractInterface>(httpContext, parameters[1]);
|
|
|
+ global::Microsoft.AspNetCore.Http.Generators.Tests.BindAsyncFromExplicitStaticAbstractInterface myBindAsyncParam_local;
|
|
|
+ if ((object?)myBindAsyncParam_temp == null)
|
|
|
+ {
|
|
|
+ wasParamCheckFailure = true;
|
|
|
+ myBindAsyncParam_local = default!;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ myBindAsyncParam_local = (global::Microsoft.AspNetCore.Http.Generators.Tests.BindAsyncFromExplicitStaticAbstractInterface)myBindAsyncParam_temp;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (wasParamCheckFailure)
|
|
|
+ {
|
|
|
+ httpContext.Response.StatusCode = 400;
|
|
|
+ }
|
|
|
+ var result = await filteredInvocation(EndpointFilterInvocationContext.Create<global::Microsoft.AspNetCore.Http.HttpContext, global::Microsoft.AspNetCore.Http.Generators.Tests.BindAsyncFromExplicitStaticAbstractInterface>(httpContext, httpContext_local, myBindAsyncParam_local));
|
|
|
+ await GeneratedRouteBuilderExtensionsCore.ExecuteObjectResult(result, httpContext);
|
|
|
+ }
|
|
|
+
|
|
|
+ RequestDelegate targetDelegate = filteredInvocation is null ? RequestHandler : RequestHandlerFiltered;
|
|
|
+ var metadata = inferredMetadataResult?.EndpointMetadata ?? ReadOnlyCollection<object>.Empty;
|
|
|
+ return new RequestDelegateResult(targetDelegate, metadata);
|
|
|
+ }),
|
|
|
+ [(@"TestMapActions.cs", 41)] = (
|
|
|
+ (methodInfo, options) =>
|
|
|
+ {
|
|
|
+ Debug.Assert(options?.EndpointBuilder != null, "EndpointBuilder not found.");
|
|
|
+ options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 41));
|
|
|
+ return new RequestDelegateMetadataResult { EndpointMetadata = options.EndpointBuilder.Metadata.AsReadOnly() };
|
|
|
+ },
|
|
|
+ (del, options, inferredMetadataResult) =>
|
|
|
+ {
|
|
|
+ var handler = (Func<global::Microsoft.AspNetCore.Http.Generators.Tests.BindAsyncFromExplicitStaticAbstractInterface?, global::System.String>)del;
|
|
|
+ EndpointFilterDelegate? filteredInvocation = null;
|
|
|
+ var parameters = del.Method.GetParameters();
|
|
|
+
|
|
|
+ if (options?.EndpointBuilder?.FilterFactories.Count > 0)
|
|
|
+ {
|
|
|
+ filteredInvocation = GeneratedRouteBuilderExtensionsCore.BuildFilterDelegate(ic =>
|
|
|
+ {
|
|
|
+ if (ic.HttpContext.Response.StatusCode == 400)
|
|
|
+ {
|
|
|
+ return ValueTask.FromResult<object?>(Results.Empty);
|
|
|
+ }
|
|
|
+ return ValueTask.FromResult<object?>(handler(ic.GetArgument<global::Microsoft.AspNetCore.Http.Generators.Tests.BindAsyncFromExplicitStaticAbstractInterface?>(0)));
|
|
|
+ },
|
|
|
+ options.EndpointBuilder,
|
|
|
+ handler.Method);
|
|
|
+ }
|
|
|
+
|
|
|
+ async Task RequestHandler(HttpContext httpContext)
|
|
|
+ {
|
|
|
+ var wasParamCheckFailure = false;
|
|
|
+ var myBindAsyncParam_temp = await BindAsync<global::Microsoft.AspNetCore.Http.Generators.Tests.BindAsyncFromExplicitStaticAbstractInterface>(httpContext, parameters[0]);
|
|
|
+ var myBindAsyncParam_local = (global::Microsoft.AspNetCore.Http.Generators.Tests.BindAsyncFromExplicitStaticAbstractInterface?)myBindAsyncParam_temp;
|
|
|
+
|
|
|
+ if (wasParamCheckFailure)
|
|
|
+ {
|
|
|
+ httpContext.Response.StatusCode = 400;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ httpContext.Response.ContentType ??= "text/plain";
|
|
|
+ var result = handler(myBindAsyncParam_local);
|
|
|
+ await httpContext.Response.WriteAsync(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ async Task RequestHandlerFiltered(HttpContext httpContext)
|
|
|
+ {
|
|
|
+ var wasParamCheckFailure = false;
|
|
|
+ var myBindAsyncParam_temp = await BindAsync<global::Microsoft.AspNetCore.Http.Generators.Tests.BindAsyncFromExplicitStaticAbstractInterface>(httpContext, parameters[0]);
|
|
|
+ var myBindAsyncParam_local = (global::Microsoft.AspNetCore.Http.Generators.Tests.BindAsyncFromExplicitStaticAbstractInterface?)myBindAsyncParam_temp;
|
|
|
+
|
|
|
+ if (wasParamCheckFailure)
|
|
|
+ {
|
|
|
+ httpContext.Response.StatusCode = 400;
|
|
|
+ }
|
|
|
+ var result = await filteredInvocation(EndpointFilterInvocationContext.Create<global::Microsoft.AspNetCore.Http.Generators.Tests.BindAsyncFromExplicitStaticAbstractInterface?>(httpContext, myBindAsyncParam_local));
|
|
|
+ await GeneratedRouteBuilderExtensionsCore.ExecuteObjectResult(result, httpContext);
|
|
|
+ }
|
|
|
+
|
|
|
+ RequestDelegate targetDelegate = filteredInvocation is null ? RequestHandler : RequestHandlerFiltered;
|
|
|
+ var metadata = inferredMetadataResult?.EndpointMetadata ?? ReadOnlyCollection<object>.Empty;
|
|
|
+ return new RequestDelegateResult(targetDelegate, metadata);
|
|
|
+ }),
|
|
|
+
|
|
|
+ };
|
|
|
+
|
|
|
+ internal static RouteHandlerBuilder MapCore(
|
|
|
+ this IEndpointRouteBuilder routes,
|
|
|
+ string pattern,
|
|
|
+ Delegate handler,
|
|
|
+ IEnumerable<string> httpMethods,
|
|
|
+ string filePath,
|
|
|
+ int lineNumber)
|
|
|
+ {
|
|
|
+ var (populateMetadata, createRequestDelegate) = map[(filePath, lineNumber)];
|
|
|
+ return RouteHandlerServices.Map(routes, pattern, handler, httpMethods, populateMetadata, createRequestDelegate);
|
|
|
+ }
|
|
|
+
|
|
|
+ private static EndpointFilterDelegate BuildFilterDelegate(EndpointFilterDelegate filteredInvocation, EndpointBuilder builder, MethodInfo mi)
|
|
|
+ {
|
|
|
+ var routeHandlerFilters = builder.FilterFactories;
|
|
|
+ var context0 = new EndpointFilterFactoryContext
|
|
|
+ {
|
|
|
+ MethodInfo = mi,
|
|
|
+ ApplicationServices = builder.ApplicationServices,
|
|
|
+ };
|
|
|
+ var initialFilteredInvocation = filteredInvocation;
|
|
|
+ for (var i = routeHandlerFilters.Count - 1; i >= 0; i--)
|
|
|
+ {
|
|
|
+ var filterFactory = routeHandlerFilters[i];
|
|
|
+ filteredInvocation = filterFactory(context0, filteredInvocation);
|
|
|
+ }
|
|
|
+ return filteredInvocation;
|
|
|
+ }
|
|
|
+
|
|
|
+ private static Task ExecuteObjectResult(object? obj, HttpContext httpContext)
|
|
|
+ {
|
|
|
+ if (obj is IResult r)
|
|
|
+ {
|
|
|
+ return r.ExecuteAsync(httpContext);
|
|
|
+ }
|
|
|
+ else if (obj is string s)
|
|
|
+ {
|
|
|
+ return httpContext.Response.WriteAsync(s);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return httpContext.Response.WriteAsJsonAsync(obj);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private static Func<HttpContext, StringValues> ResolveFromRouteOrQuery(string parameterName, IEnumerable<string>? routeParameterNames)
|
|
|
+ {
|
|
|
+ return routeParameterNames?.Contains(parameterName, StringComparer.OrdinalIgnoreCase) == true
|
|
|
+ ? (httpContext) => new StringValues((string?)httpContext.Request.RouteValues[parameterName])
|
|
|
+ : (httpContext) => httpContext.Request.Query[parameterName];
|
|
|
+ }
|
|
|
+
|
|
|
+ private static Task WriteToResponseAsync<T>(T? value, HttpContext httpContext, JsonTypeInfo<T> jsonTypeInfo, JsonSerializerOptions options)
|
|
|
+ {
|
|
|
+ var runtimeType = value?.GetType();
|
|
|
+ if (runtimeType is null || jsonTypeInfo.Type == runtimeType || jsonTypeInfo.PolymorphismOptions is not null)
|
|
|
+ {
|
|
|
+ return httpContext.Response.WriteAsJsonAsync(value!, jsonTypeInfo);
|
|
|
+ }
|
|
|
+
|
|
|
+ return httpContext.Response.WriteAsJsonAsync(value!, options.GetTypeInfo(runtimeType));
|
|
|
+ }
|
|
|
+
|
|
|
+ private static async ValueTask<(bool, T?)> TryResolveBody<T>(HttpContext httpContext, bool allowEmpty)
|
|
|
+ {
|
|
|
+ var feature = httpContext.Features.Get<Microsoft.AspNetCore.Http.Features.IHttpRequestBodyDetectionFeature>();
|
|
|
+
|
|
|
+ if (feature?.CanHaveBody == true)
|
|
|
+ {
|
|
|
+ if (!httpContext.Request.HasJsonContentType())
|
|
|
+ {
|
|
|
+ httpContext.Response.StatusCode = StatusCodes.Status415UnsupportedMediaType;
|
|
|
+ return (false, default);
|
|
|
+ }
|
|
|
+ try
|
|
|
+ {
|
|
|
+ var bodyValue = await httpContext.Request.ReadFromJsonAsync<T>();
|
|
|
+ if (!allowEmpty && bodyValue == null)
|
|
|
+ {
|
|
|
+ httpContext.Response.StatusCode = StatusCodes.Status400BadRequest;
|
|
|
+ return (false, bodyValue);
|
|
|
+ }
|
|
|
+ return (true, bodyValue);
|
|
|
+ }
|
|
|
+ catch (IOException)
|
|
|
+ {
|
|
|
+ return (false, default);
|
|
|
+ }
|
|
|
+ catch (System.Text.Json.JsonException)
|
|
|
+ {
|
|
|
+ httpContext.Response.StatusCode = StatusCodes.Status400BadRequest;
|
|
|
+ return (false, default);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return (false, default);
|
|
|
+ }
|
|
|
+
|
|
|
+ private static ValueTask<T?> BindAsync<T>(HttpContext context, ParameterInfo parameter)
|
|
|
+ where T : class, IBindableFromHttpContext<T>
|
|
|
+ {
|
|
|
+ return T.BindAsync(context, parameter);
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|