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>
159
return
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)
210
var exNullAction = Assert.Throws<ArgumentNullException>(() => RequestDelegateFactory.
Create
(handler: null!));
587
var factoryResult = RequestDelegateFactory.
Create
(action);
640
var factoryResult = RequestDelegateFactory.
Create
((HttpContext context,
665
var factoryResult = RequestDelegateFactory.
Create
((HttpContext context,
694
var resultFactory = RequestDelegateFactory.
Create
(
729
var ex = Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.
Create
(action));
738
var ex = Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.
Create
(lambda.Compile()));
891
var factoryResult = RequestDelegateFactory.
Create
(action);
906
var ex1 = Assert.Throws<NotSupportedException>(() => RequestDelegateFactory.
Create
(Method1));
907
var ex2 = Assert.Throws<NotSupportedException>(() => RequestDelegateFactory.
Create
(Method2));
908
var ex3 = Assert.Throws<NotSupportedException>(() => RequestDelegateFactory.
Create
(Method3));
932
Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.
Create
(TestAttributedInvalidAction));
933
Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.
Create
(TestInferredInvalidAction));
934
Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.
Create
(TestBothInvalidAction));
943
Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.
Create
(TestTryParseStruct));
944
Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.
Create
(TestTryParseClass));
966
var ex = Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.
Create
(TestBindAsyncStruct));
967
Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.
Create
(TestBindAsyncClass));
1021
var exception = Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.
Create
(@delegate));
1031
Assert.Throws<NotSupportedException>(() => RequestDelegateFactory.
Create
(TestNestedParameterListRecordOnType));
1032
Assert.Throws<NotSupportedException>(() => RequestDelegateFactory.
Create
(TestNestedParameterListRecordOnArgument));
1122
var outParamException = Assert.Throws<NotSupportedException>(() => RequestDelegateFactory.
Create
(OutMethod));
1123
var inParamException = Assert.Throws<NotSupportedException>(() => RequestDelegateFactory.
Create
(InMethod));
1124
var refParamException = Assert.Throws<NotSupportedException>(() => RequestDelegateFactory.
Create
(RefMethod));
1139
var factoryResult = RequestDelegateFactory.
Create
(action);
1161
var requestDelegateResult = RequestDelegateFactory.
Create
(action);
1204
var factoryResult = RequestDelegateFactory.
Create
(TestAction);
1228
var factoryResult = RequestDelegateFactory.
Create
(TestAction);
1249
var factoryResult = RequestDelegateFactory.
Create
(TestAction);
1269
var factoryResult = RequestDelegateFactory.
Create
(TestAction);
1289
var factoryResult = RequestDelegateFactory.
Create
(TestAction);
1349
var factoryResult = RequestDelegateFactory.
Create
(@delegate);
1382
var factoryResult = RequestDelegateFactory.
Create
(@delegate);
1478
var factoryResult = RequestDelegateFactory.
Create
(@delegate);
1517
var factoryResult = RequestDelegateFactory.
Create
(@delegate);
1670
var factoryResult = RequestDelegateFactory.
Create
(routeHandler);
1783
var factoryResult = RequestDelegateFactory.
Create
(optionalQueryParam);
1813
var factoryResult = RequestDelegateFactory.
Create
(optionalQueryParam);
1843
var factoryResult = RequestDelegateFactory.
Create
(optionalQueryParam);
1870
var factoryResult = RequestDelegateFactory.
Create
(actionWithExtensionsResult);
1910
var factoryResult = RequestDelegateFactory.
Create
(@delegate);
1939
var factoryResult = RequestDelegateFactory.
Create
(TestAction);
1972
var factoryResult = RequestDelegateFactory.
Create
(TestAction);
2003
Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.
Create
(TestFormFileAndJson));
2004
Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.
Create
(TestFormFilesAndJson));
2005
Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.
Create
(TestFormFileAndJsonWithAttribute));
2006
Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.
Create
(TestFormFileCollectionAndJson));
2007
Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.
Create
(TestFormCollectionAndJson));
2008
Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.
Create
(TestFormWithAttributeAndJson));
2009
Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.
Create
(TestJsonAndFormFile));
2010
Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.
Create
(TestJsonAndFormFiles));
2011
Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.
Create
(TestJsonAndFormFileCollection));
2012
Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.
Create
(TestJsonAndFormFileWithAttribute));
2013
Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.
Create
(TestJsonAndFormCollection));
2014
Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.
Create
(TestJsonAndFormWithAttribute));
2027
var nse = Assert.Throws<NotSupportedException>(() => RequestDelegateFactory.
Create
(TestAction));
2076
var nse = Assert.Throws<NotSupportedException>(() => RequestDelegateFactory.
Create
(TestAction));
2113
var exception = Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.
Create
(action));
2126
var exception = Assert.Throws<ArgumentException>(() => RequestDelegateFactory.
Create
(TestAction));
2523
var result = RequestDelegateFactory.
Create
(@delegate);
2534
var result = RequestDelegateFactory.
Create
(@delegate);
2546
var result = RequestDelegateFactory.
Create
(@delegate);
2582
var result = RequestDelegateFactory.
Create
(@delegate);
2596
var result = RequestDelegateFactory.
Create
(@delegate);
2610
var result = RequestDelegateFactory.
Create
(@delegate);
2623
var result = RequestDelegateFactory.
Create
(@delegate);
2636
var result = RequestDelegateFactory.
Create
(@delegate);
2649
var result = RequestDelegateFactory.
Create
(@delegate);
2662
var result = RequestDelegateFactory.
Create
(@delegate);
2884
var result = RequestDelegateFactory.
Create
(@delegate, options, metadataResult);
2941
var result = RequestDelegateFactory.
Create
(@delegate);
2954
var result = RequestDelegateFactory.
Create
(@delegate);
2967
var result = RequestDelegateFactory.
Create
(@delegate);
2980
var result = RequestDelegateFactory.
Create
(@delegate);
2993
var result = RequestDelegateFactory.
Create
(@delegate);
3142
var factoryResult = RequestDelegateFactory.
Create
(TestAction);
3191
var factoryResult = RequestDelegateFactory.
Create
(TestAction);
3232
var exception = Assert.Throws<NotSupportedException>(() => RequestDelegateFactory.
Create
(@delegate));
3251
var exception = Record.Exception(() => RequestDelegateFactory.
Create
(@delegate));
RequestDelegateFactoryTests.FormMapping.cs (7)
54
var factoryResult = RequestDelegateFactory.
Create
(TestAction, options, metadataResult);
101
var factoryResult = RequestDelegateFactory.
Create
(TestAction, options, metadataResult);
149
var factoryResult = RequestDelegateFactory.
Create
(TestAction, options, metadataResult);
196
var factoryResult = RequestDelegateFactory.
Create
(TestAction);
229
var factoryResult = RequestDelegateFactory.
Create
(TestAction);
277
var factoryResult = RequestDelegateFactory.
Create
(TestAction, options, metadataResult);
299
var factoryResult = RequestDelegateFactory.
Create
(TestAction);
Microsoft.AspNetCore.Routing (1)
Builder\EndpointRouteBuilderExtensions.cs (1)
439
.AddRouteHandler(pattern, handler, httpMethods, isFallback, RequestDelegateFactory.InferMetadata, RequestDelegateFactory.
Create
, handler.Method);