95 references to Create
Microsoft.AspNetCore.Http.Extensions (8)
RequestDelegateFactory.cs (7)
133/// Returns metadata inferred automatically for the <see cref="RequestDelegate"/> created by <see cref="Create(Delegate, RequestDelegateFactoryOptions?, RequestDelegateMetadataResult?)"/>. 136/// <param name="methodInfo">The <see cref="MethodInfo"/> for the route handler to be passed to <see cref="Create(Delegate, RequestDelegateFactoryOptions?, RequestDelegateMetadataResult?)"/>.</param> 137/// <param name="options">The options that will be used when calling <see cref="Create(Delegate, RequestDelegateFactoryOptions?, RequestDelegateMetadataResult?)"/>.</param> 138/// <returns>The <see cref="RequestDelegateMetadataResult"/> to be passed to <see cref="Create(Delegate, RequestDelegateFactoryOptions?, RequestDelegateMetadataResult?)"/>.</returns> 159return Create(handler, options, metadataResult: null); 169/// If <see langword="null"/>, this call to <see cref="Create(Delegate, RequestDelegateFactoryOptions?, RequestDelegateMetadataResult?)"/> method will infer the metadata that 221/// 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 (86)
RequestDelegateFactoryTests.cs (79)
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, 694var resultFactory = RequestDelegateFactory.Create( 729var ex = Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.Create(action)); 738var ex = Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.Create(lambda.Compile())); 891var factoryResult = RequestDelegateFactory.Create(action); 906var ex1 = Assert.Throws<NotSupportedException>(() => RequestDelegateFactory.Create(Method1)); 907var ex2 = Assert.Throws<NotSupportedException>(() => RequestDelegateFactory.Create(Method2)); 908var ex3 = Assert.Throws<NotSupportedException>(() => RequestDelegateFactory.Create(Method3)); 932Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.Create(TestAttributedInvalidAction)); 933Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.Create(TestInferredInvalidAction)); 934Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.Create(TestBothInvalidAction)); 943Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.Create(TestTryParseStruct)); 944Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.Create(TestTryParseClass)); 966var ex = Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.Create(TestBindAsyncStruct)); 967Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.Create(TestBindAsyncClass)); 1021var exception = Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.Create(@delegate)); 1031Assert.Throws<NotSupportedException>(() => RequestDelegateFactory.Create(TestNestedParameterListRecordOnType)); 1032Assert.Throws<NotSupportedException>(() => RequestDelegateFactory.Create(TestNestedParameterListRecordOnArgument)); 1122var outParamException = Assert.Throws<NotSupportedException>(() => RequestDelegateFactory.Create(OutMethod)); 1123var inParamException = Assert.Throws<NotSupportedException>(() => RequestDelegateFactory.Create(InMethod)); 1124var refParamException = Assert.Throws<NotSupportedException>(() => RequestDelegateFactory.Create(RefMethod)); 1139var factoryResult = RequestDelegateFactory.Create(action); 1161var requestDelegateResult = RequestDelegateFactory.Create(action); 1204var factoryResult = RequestDelegateFactory.Create(TestAction); 1228var factoryResult = RequestDelegateFactory.Create(TestAction); 1249var factoryResult = RequestDelegateFactory.Create(TestAction); 1269var factoryResult = RequestDelegateFactory.Create(TestAction); 1289var factoryResult = RequestDelegateFactory.Create(TestAction); 1349var factoryResult = RequestDelegateFactory.Create(@delegate); 1382var factoryResult = RequestDelegateFactory.Create(@delegate); 1478var factoryResult = RequestDelegateFactory.Create(@delegate); 1517var factoryResult = RequestDelegateFactory.Create(@delegate); 1670var factoryResult = RequestDelegateFactory.Create(routeHandler); 1783var factoryResult = RequestDelegateFactory.Create(optionalQueryParam); 1813var factoryResult = RequestDelegateFactory.Create(optionalQueryParam); 1843var factoryResult = RequestDelegateFactory.Create(optionalQueryParam); 1870var factoryResult = RequestDelegateFactory.Create(actionWithExtensionsResult); 1910var factoryResult = RequestDelegateFactory.Create(@delegate); 1939var factoryResult = RequestDelegateFactory.Create(TestAction); 1972var factoryResult = RequestDelegateFactory.Create(TestAction); 2003Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.Create(TestFormFileAndJson)); 2004Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.Create(TestFormFilesAndJson)); 2005Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.Create(TestFormFileAndJsonWithAttribute)); 2006Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.Create(TestFormFileCollectionAndJson)); 2007Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.Create(TestFormCollectionAndJson)); 2008Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.Create(TestFormWithAttributeAndJson)); 2009Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.Create(TestJsonAndFormFile)); 2010Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.Create(TestJsonAndFormFiles)); 2011Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.Create(TestJsonAndFormFileCollection)); 2012Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.Create(TestJsonAndFormFileWithAttribute)); 2013Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.Create(TestJsonAndFormCollection)); 2014Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.Create(TestJsonAndFormWithAttribute)); 2027var nse = Assert.Throws<NotSupportedException>(() => RequestDelegateFactory.Create(TestAction)); 2076var nse = Assert.Throws<NotSupportedException>(() => RequestDelegateFactory.Create(TestAction)); 2113var exception = Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.Create(action)); 2126var exception = Assert.Throws<ArgumentException>(() => RequestDelegateFactory.Create(TestAction)); 2523var result = RequestDelegateFactory.Create(@delegate); 2534var result = RequestDelegateFactory.Create(@delegate); 2546var result = RequestDelegateFactory.Create(@delegate); 2582var result = RequestDelegateFactory.Create(@delegate); 2596var result = RequestDelegateFactory.Create(@delegate); 2610var result = RequestDelegateFactory.Create(@delegate); 2623var result = RequestDelegateFactory.Create(@delegate); 2636var result = RequestDelegateFactory.Create(@delegate); 2649var result = RequestDelegateFactory.Create(@delegate); 2662var result = RequestDelegateFactory.Create(@delegate); 2884var result = RequestDelegateFactory.Create(@delegate, options, metadataResult); 2941var result = RequestDelegateFactory.Create(@delegate); 2954var result = RequestDelegateFactory.Create(@delegate); 2967var result = RequestDelegateFactory.Create(@delegate); 2980var result = RequestDelegateFactory.Create(@delegate); 2993var result = RequestDelegateFactory.Create(@delegate); 3142var factoryResult = RequestDelegateFactory.Create(TestAction); 3191var factoryResult = RequestDelegateFactory.Create(TestAction); 3232var exception = Assert.Throws<NotSupportedException>(() => RequestDelegateFactory.Create(@delegate)); 3251var 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);