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>
161
return
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)
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,
696
var factoryResult = RequestDelegateFactory.
Create
(
722
var resultFactory = RequestDelegateFactory.
Create
(
757
var ex = Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.
Create
(action));
766
var ex = Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.
Create
(lambda.Compile()));
919
var factoryResult = RequestDelegateFactory.
Create
(action);
934
var ex1 = Assert.Throws<NotSupportedException>(() => RequestDelegateFactory.
Create
(Method1));
935
var ex2 = Assert.Throws<NotSupportedException>(() => RequestDelegateFactory.
Create
(Method2));
936
var ex3 = Assert.Throws<NotSupportedException>(() => RequestDelegateFactory.
Create
(Method3));
960
Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.
Create
(TestAttributedInvalidAction));
961
Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.
Create
(TestInferredInvalidAction));
962
Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.
Create
(TestBothInvalidAction));
971
Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.
Create
(TestTryParseStruct));
972
Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.
Create
(TestTryParseClass));
994
var ex = Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.
Create
(TestBindAsyncStruct));
995
Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.
Create
(TestBindAsyncClass));
1049
var exception = Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.
Create
(@delegate));
1059
Assert.Throws<NotSupportedException>(() => RequestDelegateFactory.
Create
(TestNestedParameterListRecordOnType));
1060
Assert.Throws<NotSupportedException>(() => RequestDelegateFactory.
Create
(TestNestedParameterListRecordOnArgument));
1150
var outParamException = Assert.Throws<NotSupportedException>(() => RequestDelegateFactory.
Create
(OutMethod));
1151
var inParamException = Assert.Throws<NotSupportedException>(() => RequestDelegateFactory.
Create
(InMethod));
1152
var refParamException = Assert.Throws<NotSupportedException>(() => RequestDelegateFactory.
Create
(RefMethod));
1167
var factoryResult = RequestDelegateFactory.
Create
(action);
1189
var requestDelegateResult = RequestDelegateFactory.
Create
(action);
1232
var factoryResult = RequestDelegateFactory.
Create
(TestAction);
1256
var factoryResult = RequestDelegateFactory.
Create
(TestAction);
1277
var factoryResult = RequestDelegateFactory.
Create
(TestAction);
1297
var factoryResult = RequestDelegateFactory.
Create
(TestAction);
1317
var factoryResult = RequestDelegateFactory.
Create
(TestAction);
1377
var factoryResult = RequestDelegateFactory.
Create
(@delegate);
1410
var factoryResult = RequestDelegateFactory.
Create
(@delegate);
1506
var factoryResult = RequestDelegateFactory.
Create
(@delegate);
1545
var factoryResult = RequestDelegateFactory.
Create
(@delegate);
1698
var factoryResult = RequestDelegateFactory.
Create
(routeHandler);
1811
var factoryResult = RequestDelegateFactory.
Create
(optionalQueryParam);
1841
var factoryResult = RequestDelegateFactory.
Create
(optionalQueryParam);
1871
var factoryResult = RequestDelegateFactory.
Create
(optionalQueryParam);
1898
var factoryResult = RequestDelegateFactory.
Create
(actionWithExtensionsResult);
1938
var factoryResult = RequestDelegateFactory.
Create
(@delegate);
1967
var factoryResult = RequestDelegateFactory.
Create
(TestAction);
2000
var factoryResult = RequestDelegateFactory.
Create
(TestAction);
2031
Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.
Create
(TestFormFileAndJson));
2032
Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.
Create
(TestFormFilesAndJson));
2033
Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.
Create
(TestFormFileAndJsonWithAttribute));
2034
Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.
Create
(TestFormFileCollectionAndJson));
2035
Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.
Create
(TestFormCollectionAndJson));
2036
Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.
Create
(TestFormWithAttributeAndJson));
2037
Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.
Create
(TestJsonAndFormFile));
2038
Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.
Create
(TestJsonAndFormFiles));
2039
Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.
Create
(TestJsonAndFormFileCollection));
2040
Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.
Create
(TestJsonAndFormFileWithAttribute));
2041
Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.
Create
(TestJsonAndFormCollection));
2042
Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.
Create
(TestJsonAndFormWithAttribute));
2055
var nse = Assert.Throws<NotSupportedException>(() => RequestDelegateFactory.
Create
(TestAction));
2104
var nse = Assert.Throws<NotSupportedException>(() => RequestDelegateFactory.
Create
(TestAction));
2141
var exception = Assert.Throws<InvalidOperationException>(() => RequestDelegateFactory.
Create
(action));
2154
var exception = Assert.Throws<ArgumentException>(() => RequestDelegateFactory.
Create
(TestAction));
2551
var result = RequestDelegateFactory.
Create
(@delegate);
2562
var result = RequestDelegateFactory.
Create
(@delegate);
2574
var result = RequestDelegateFactory.
Create
(@delegate);
2610
var result = RequestDelegateFactory.
Create
(@delegate);
2624
var result = RequestDelegateFactory.
Create
(@delegate);
2638
var result = RequestDelegateFactory.
Create
(@delegate);
2651
var result = RequestDelegateFactory.
Create
(@delegate);
2664
var result = RequestDelegateFactory.
Create
(@delegate);
2677
var result = RequestDelegateFactory.
Create
(@delegate);
2690
var result = RequestDelegateFactory.
Create
(@delegate);
2915
var result = RequestDelegateFactory.
Create
(@delegate, options, metadataResult);
2972
var result = RequestDelegateFactory.
Create
(@delegate);
2985
var result = RequestDelegateFactory.
Create
(@delegate);
2998
var result = RequestDelegateFactory.
Create
(@delegate);
3011
var result = RequestDelegateFactory.
Create
(@delegate);
3024
var result = RequestDelegateFactory.
Create
(@delegate);
3173
var factoryResult = RequestDelegateFactory.
Create
(TestAction);
3226
var factoryResult = RequestDelegateFactory.
Create
(TestAction);
3271
var factoryResult = RequestDelegateFactory.
Create
(TestAction);
3312
var exception = Assert.Throws<NotSupportedException>(() => RequestDelegateFactory.
Create
(@delegate));
3331
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);