97 references to Create
Microsoft.AspNetCore.Http.Extensions (8)
RequestDelegateFactory.cs (7)
135/// Returns metadata inferred automatically for the <see cref="RequestDelegate"/> created by <see cref="Create(Delegate, RequestDelegateFactoryOptions?, RequestDelegateMetadataResult?)"/>. 138/// <param name="methodInfo">The <see cref="MethodInfo"/> for the route handler to be passed to <see cref="Create(Delegate, RequestDelegateFactoryOptions?, RequestDelegateMetadataResult?)"/>.</param> 139/// <param name="options">The options that will be used when calling <see cref="Create(Delegate, RequestDelegateFactoryOptions?, RequestDelegateMetadataResult?)"/>.</param> 140/// <returns>The <see cref="RequestDelegateMetadataResult"/> to be passed to <see cref="Create(Delegate, RequestDelegateFactoryOptions?, RequestDelegateMetadataResult?)"/>.</returns> 161return Create(handler, options, metadataResult: null); 171/// If <see langword="null"/>, this call to <see cref="Create(Delegate, RequestDelegateFactoryOptions?, RequestDelegateMetadataResult?)"/> method will infer the metadata that 223/// If <see langword="null"/>, this call to <see cref="Create(Delegate, RequestDelegateFactoryOptions?, RequestDelegateMetadataResult?)"/> method will infer the metadata that
RequestDelegateMetadataResult.cs (1)
9/// If this is passed to <see cref="RequestDelegateFactory.Create(Delegate, Microsoft.AspNetCore.Http.RequestDelegateFactoryOptions?, Microsoft.AspNetCore.Http.RequestDelegateMetadataResult?)"/>,
Microsoft.AspNetCore.Http.Extensions.Tests (88)
RequestDelegateFactoryTests.cs (81)
210var exNullAction = Assert.Throws<ArgumentNullException>(() => RequestDelegateFactory.Create(handler: null!)); 587var factoryResult = RequestDelegateFactory.Create(action); 640var factoryResult = RequestDelegateFactory.Create((HttpContext context, 665var factoryResult = RequestDelegateFactory.Create((HttpContext context, 696var factoryResult = RequestDelegateFactory.Create( 722var resultFactory = RequestDelegateFactory.Create( 757var ex = Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.Create(action)); 766var ex = Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.Create(lambda.Compile())); 919var factoryResult = RequestDelegateFactory.Create(action); 934var ex1 = Assert.Throws<NotSupportedException>(() => RequestDelegateFactory.Create(Method1)); 935var ex2 = Assert.Throws<NotSupportedException>(() => RequestDelegateFactory.Create(Method2)); 936var ex3 = Assert.Throws<NotSupportedException>(() => RequestDelegateFactory.Create(Method3)); 960Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.Create(TestAttributedInvalidAction)); 961Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.Create(TestInferredInvalidAction)); 962Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.Create(TestBothInvalidAction)); 971Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.Create(TestTryParseStruct)); 972Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.Create(TestTryParseClass)); 994var ex = Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.Create(TestBindAsyncStruct)); 995Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.Create(TestBindAsyncClass)); 1049var exception = Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.Create(@delegate)); 1059Assert.Throws<NotSupportedException>(() => RequestDelegateFactory.Create(TestNestedParameterListRecordOnType)); 1060Assert.Throws<NotSupportedException>(() => RequestDelegateFactory.Create(TestNestedParameterListRecordOnArgument)); 1150var outParamException = Assert.Throws<NotSupportedException>(() => RequestDelegateFactory.Create(OutMethod)); 1151var inParamException = Assert.Throws<NotSupportedException>(() => RequestDelegateFactory.Create(InMethod)); 1152var refParamException = Assert.Throws<NotSupportedException>(() => RequestDelegateFactory.Create(RefMethod)); 1167var factoryResult = RequestDelegateFactory.Create(action); 1189var requestDelegateResult = RequestDelegateFactory.Create(action); 1232var factoryResult = RequestDelegateFactory.Create(TestAction); 1256var factoryResult = RequestDelegateFactory.Create(TestAction); 1277var factoryResult = RequestDelegateFactory.Create(TestAction); 1297var factoryResult = RequestDelegateFactory.Create(TestAction); 1317var factoryResult = RequestDelegateFactory.Create(TestAction); 1377var factoryResult = RequestDelegateFactory.Create(@delegate); 1410var factoryResult = RequestDelegateFactory.Create(@delegate); 1506var factoryResult = RequestDelegateFactory.Create(@delegate); 1545var factoryResult = RequestDelegateFactory.Create(@delegate); 1698var factoryResult = RequestDelegateFactory.Create(routeHandler); 1811var factoryResult = RequestDelegateFactory.Create(optionalQueryParam); 1841var factoryResult = RequestDelegateFactory.Create(optionalQueryParam); 1871var factoryResult = RequestDelegateFactory.Create(optionalQueryParam); 1898var factoryResult = RequestDelegateFactory.Create(actionWithExtensionsResult); 1938var factoryResult = RequestDelegateFactory.Create(@delegate); 1967var factoryResult = RequestDelegateFactory.Create(TestAction); 2000var factoryResult = RequestDelegateFactory.Create(TestAction); 2031Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.Create(TestFormFileAndJson)); 2032Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.Create(TestFormFilesAndJson)); 2033Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.Create(TestFormFileAndJsonWithAttribute)); 2034Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.Create(TestFormFileCollectionAndJson)); 2035Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.Create(TestFormCollectionAndJson)); 2036Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.Create(TestFormWithAttributeAndJson)); 2037Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.Create(TestJsonAndFormFile)); 2038Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.Create(TestJsonAndFormFiles)); 2039Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.Create(TestJsonAndFormFileCollection)); 2040Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.Create(TestJsonAndFormFileWithAttribute)); 2041Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.Create(TestJsonAndFormCollection)); 2042Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.Create(TestJsonAndFormWithAttribute)); 2055var nse = Assert.Throws<NotSupportedException>(() => RequestDelegateFactory.Create(TestAction)); 2104var nse = Assert.Throws<NotSupportedException>(() => RequestDelegateFactory.Create(TestAction)); 2141var exception = Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.Create(action)); 2154var exception = Assert.Throws<ArgumentException>(() => RequestDelegateFactory.Create(TestAction)); 2551var result = RequestDelegateFactory.Create(@delegate); 2562var result = RequestDelegateFactory.Create(@delegate); 2574var result = RequestDelegateFactory.Create(@delegate); 2610var result = RequestDelegateFactory.Create(@delegate); 2624var result = RequestDelegateFactory.Create(@delegate); 2638var result = RequestDelegateFactory.Create(@delegate); 2651var result = RequestDelegateFactory.Create(@delegate); 2664var result = RequestDelegateFactory.Create(@delegate); 2677var result = RequestDelegateFactory.Create(@delegate); 2690var result = RequestDelegateFactory.Create(@delegate); 2915var result = RequestDelegateFactory.Create(@delegate, options, metadataResult); 2972var result = RequestDelegateFactory.Create(@delegate); 2985var result = RequestDelegateFactory.Create(@delegate); 2998var result = RequestDelegateFactory.Create(@delegate); 3011var result = RequestDelegateFactory.Create(@delegate); 3024var result = RequestDelegateFactory.Create(@delegate); 3173var factoryResult = RequestDelegateFactory.Create(TestAction); 3226var factoryResult = RequestDelegateFactory.Create(TestAction); 3271var factoryResult = RequestDelegateFactory.Create(TestAction); 3312var exception = Assert.Throws<NotSupportedException>(() => RequestDelegateFactory.Create(@delegate)); 3331var exception = Record.Exception(() => RequestDelegateFactory.Create(@delegate));
RequestDelegateFactoryTests.FormMapping.cs (7)
54var factoryResult = RequestDelegateFactory.Create(TestAction, options, metadataResult); 101var factoryResult = RequestDelegateFactory.Create(TestAction, options, metadataResult); 149var factoryResult = RequestDelegateFactory.Create(TestAction, options, metadataResult); 196var factoryResult = RequestDelegateFactory.Create(TestAction); 229var factoryResult = RequestDelegateFactory.Create(TestAction); 277var factoryResult = RequestDelegateFactory.Create(TestAction, options, metadataResult); 299var factoryResult = RequestDelegateFactory.Create(TestAction);
Microsoft.AspNetCore.Routing (1)
Builder\EndpointRouteBuilderExtensions.cs (1)
439.AddRouteHandler(pattern, handler, httpMethods, isFallback, RequestDelegateFactory.InferMetadata, RequestDelegateFactory.Create, handler.Method);