95 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 (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); 2581var result = RequestDelegateFactory.Create(@delegate); 2595var result = RequestDelegateFactory.Create(@delegate); 2609var result = RequestDelegateFactory.Create(@delegate); 2622var result = RequestDelegateFactory.Create(@delegate); 2635var result = RequestDelegateFactory.Create(@delegate); 2648var result = RequestDelegateFactory.Create(@delegate); 2661var result = RequestDelegateFactory.Create(@delegate); 2878var result = RequestDelegateFactory.Create(@delegate, options, metadataResult); 2935var result = RequestDelegateFactory.Create(@delegate); 2948var result = RequestDelegateFactory.Create(@delegate); 2961var result = RequestDelegateFactory.Create(@delegate); 2974var result = RequestDelegateFactory.Create(@delegate); 2987var result = RequestDelegateFactory.Create(@delegate); 3136var factoryResult = RequestDelegateFactory.Create(TestAction); 3185var factoryResult = RequestDelegateFactory.Create(TestAction); 3226var exception = Assert.Throws<NotSupportedException>(() => RequestDelegateFactory.Create(@delegate)); 3245var 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);