11 instantiations of ActionResult
Microsoft.AspNetCore.Mvc.Core (2)
ActionResultOfT.cs (2)
66
return new
ActionResult
<TValue>(value);
75
return new
ActionResult
<TValue>(result);
Microsoft.AspNetCore.Mvc.Core.Test (9)
ActionResultOfTTest.cs (7)
18
var ex = Assert.Throws<ArgumentException>(() => new
ActionResult
<FileStreamResult>(value: input));
29
var ex = Assert.Throws<ArgumentException>(() => new
ActionResult
<FileStreamResult>(result: actionResult));
40
var ex = Assert.Throws<ArgumentException>(() => new
ActionResult
<TestResult>(value: result));
49
var actionResultOfT = new
ActionResult
<string>(expected);
64
var actionResultOfT = new
ActionResult
<BaseItem>(value);
82
var actionResultOfT = new
ActionResult
<ProblemDetails>(value);
100
var actionResultOfT = new
ActionResult
<BaseItem>(value);
Infrastructure\ActionMethodExecutorTest.cs (2)
468
public ActionResult<TestModel> ReturnsActionResultOfT() => new
ActionResult
<TestModel>(new TestModel());
502
public Task<ActionResult<TestModel>> ReturnActionResultOFTAsync() => Task.FromResult(new
ActionResult
<TestModel>(new TestModel()));
101 references to ActionResult
ApiExplorerWebSite (2)
Controllers\ApiExplorerResponseTypeWithApiConventionController.cs (1)
17
public Task<
ActionResult
<Product>> GetTaskOfActionResultOfProduct(int id) => null;
Controllers\ApiExplorerResponseTypeWithoutAttributeController.cs (1)
41
public
ActionResult
<Product> GetActionResultProduct() => null;
BasicWebSite (29)
Controllers\ActionResultOfTController.cs (2)
12
public
ActionResult
<Product> GetProduct(int? productId)
23
public async Task<
ActionResult
<IEnumerable<Product>>> GetProductsAsync()
Controllers\ContactApiController.cs (14)
22
public
ActionResult
<Contact> Get(int id)
34
public
ActionResult
<Contact> Post([FromBody] Contact contact)
42
public
ActionResult
<Contact> PostWithVnd([FromBody] Contact contact)
49
public
ActionResult
<Contact> ActionWithInferredFromBodyParameter(Contact contact) => contact;
52
public
ActionResult
<Contact> ActionWithInferredFromBodyParameterAndCancellationToken(Contact contact, CancellationToken cts)
56
public
ActionResult
<Contact> ActionWithInferredRouteAndQueryParameter(int id, string name, string email)
67
public
ActionResult
<Contact> ActionWithInferredEmptyPrefix([FromQuery] Contact contact)
73
public
ActionResult
<string> ActionWithInferredModelBinderType(
80
public
ActionResult
<string> ActionWithInferredModelBinderTypeWithExplicitModelName(
87
public
ActionResult
<Contact> ActionWithInferredFromServicesParameter(int id, ContactsRepository repository)
91
public
ActionResult
<ContactRequest> ActionWithCompositeComplexTypeParameter(ContactRequest request, ContactsRepository repository)
95
public
ActionResult
<int> ActionReturningStatusCodeResult()
101
public
ActionResult
<int> ActionReturningProblemDetails()
118
public
ActionResult
<int> ActionReturningValidationProblemDetails()
Controllers\CustomServiceApiController.cs (6)
13
public
ActionResult
<string> GetOk([FromKeyedServices("ok_service")] ICustomService service)
19
public
ActionResult
<string> GetNotOk([FromKeyedServices("not_ok_service")] ICustomService service)
25
public
ActionResult
<string> GetBoth(
33
public
ActionResult
<string> GetKeyNull([FromKeyedServices(null)] ICustomService service)
41
public
ActionResult
<string> GetOptionalNotRegistered([FromKeyedServices("no_existing_key")] ICustomService? service)
51
public
ActionResult
<string> GetRequiredNotRegistered([FromKeyedServices("no_existing_key")] ICustomService service)
Controllers\NonNullableApiController.cs (1)
15
public
ActionResult
<string> Get(string language = "pt-br")
Controllers\RequestFormLimitsController.cs (4)
14
public
ActionResult
<Product> RequestFormLimitsBeforeAntiforgeryValidation(Product product)
26
public
ActionResult
<Product> OverrideControllerLevelLimits(Product product)
37
public
ActionResult
<Product> OverrideControllerLevelLimitsUsingDefaultLimits(Product product)
50
public
ActionResult
<Product> RequestSizeLimitBeforeRequestFormLimits(Product product)
Controllers\RequestSizeLimitController.cs (2)
14
public
ActionResult
<Product> RequestSizeLimitCheckBeforeAntiforgeryValidation(Product product)
26
public
ActionResult
<Product> DisableRequestSizeLimit([FromBody] Product product)
FormatterWebSite (15)
Controllers\JsonFormatterController.cs (3)
83
public
ActionResult
<SimpleModel> RoundtripSimpleModel([FromBody] SimpleModel model)
89
public
ActionResult
<SimpleRecordModel> RoundtripRecordType([FromBody] SimpleRecordModel model) => model;
114
public
ActionResult
<SimpleModelWithValidation> RoundtripModelWithValidation([FromBody] SimpleModelWithValidation model)
Controllers\JsonInputFormatterController.cs (1)
13
public
ActionResult
<int> IntValue(int value)
Controllers\JsonOutputFormatterController.cs (10)
14
public
ActionResult
<int> IntResult() => 2;
17
public
ActionResult
<string> StringResult() => "Hello world";
20
public
ActionResult
<string> StringWithUnicodeResult() => "Hello Mr. 🦊";
23
public
ActionResult
<string> StringWithNonAsciiContent() => "Une bête de cirque";
26
public
ActionResult
<SimpleModel> SimpleModelResult() =>
30
public
ActionResult
<IEnumerable<SimpleModel>> CollectionModelResult() =>
38
public
ActionResult
<Dictionary<string, string>> DictionaryResult() =>
47
public
ActionResult
<SimpleModel> LargeObjectResult() =>
55
public
ActionResult
<SimpleModel> PolymorphicResult() => new DerivedModel
63
public
ActionResult
<ProblemDetails> ProblemDetailsResult() => NotFound();
Controllers\SystemTextJsonOutputFormatterController.cs (1)
15
public
ActionResult
<SimpleModel> PolymorphicResult() => new DerivedModel
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (1)
Logging\ApiRoutingController.cs (1)
21
public
ActionResult
<string> GetUser(
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (11)
ApiResponseTypeProviderTest.cs (7)
72
public Task<
ActionResult
<BaseModel>> Get(int id) => null;
192
public Task<
ActionResult
<BaseModel>> DeleteBase(int id) => null;
225
public Task<
ActionResult
<BaseModel>> PostModel(int id, BaseModel model) => null;
281
public Task<
ActionResult
<BaseModel>> Put(int id, BaseModel model) => null;
807
public
ActionResult
<DerivedModel> GetUser(int id) => null;
809
public
ActionResult
<DerivedModel> GetUserLocation(int a, int b) => null;
811
public
ActionResult
<DerivedModel> PutModel(string userId, DerivedModel model) => null;
DefaultApiDescriptionProviderTest.cs (4)
2426
private
ActionResult
<Product> ReturnsActionResultOfProduct() => null;
2429
private
ActionResult
<IEnumerable<Product>> ReturnsActionResultOfSequenceOfProducts() => null;
2431
private Task<
ActionResult
<Product>> ReturnsTaskOfActionResultOfProduct() => null;
2434
private Task<
ActionResult
<IEnumerable<Product>>> ReturnsTaskOfActionResultOfSequenceOfProducts() => null;
Microsoft.AspNetCore.Mvc.Core (9)
ActionResultOfT.cs (6)
19
/// Initializes a new instance of <see cref="
ActionResult
{TValue}"/> using the specified <paramref name="value"/>.
35
/// Initializes a new instance of <see cref="
ActionResult
{TValue}"/> using the specified <see cref="ActionResult"/>.
61
/// Implicitly converts the specified <paramref name="value"/> to an <see cref="
ActionResult
{TValue}"/>.
64
public static implicit operator
ActionResult
<TValue>(TValue value)
70
/// Implicitly converts the specified <paramref name="result"/> to an <see cref="
ActionResult
{TValue}"/>.
73
public static implicit operator
ActionResult
<TValue>(ActionResult result)
Infrastructure\ActionResultTypeMapper.cs (1)
17
returnType.GetGenericTypeDefinition() == typeof(
ActionResult
<>))
Infrastructure\IActionResultTypeMapper.cs (2)
14
/// <see cref="
ActionResult
{TValue}"/> to an <see cref="IActionResult"/> during request
15
/// processing as well as the mapping of <see cref="
ActionResult
{TValue}"/> to <c>TValue</c>
Microsoft.AspNetCore.Mvc.Core.Test (7)
ActionResultOfTTest.cs (4)
49
var
actionResultOfT = new ActionResult<string>(expected);
64
var
actionResultOfT = new ActionResult<BaseItem>(value);
82
var
actionResultOfT = new ActionResult<ProblemDetails>(value);
100
var
actionResultOfT = new ActionResult<BaseItem>(value);
Infrastructure\ActionMethodExecutorTest.cs (2)
468
public
ActionResult
<TestModel> ReturnsActionResultOfT() => new ActionResult<TestModel>(new TestModel());
502
public Task<
ActionResult
<TestModel>> ReturnActionResultOFTAsync() => Task.FromResult(new ActionResult<TestModel>(new TestModel()));
Infrastructure\ActionResultTypeMapperTest.cs (1)
81
var returnType = typeof(
ActionResult
<string>);
Mvc.Api.Analyzers.Test (21)
TestFiles\ActualApiResponseMetadataFactoryTest\InspectReturnExpressionTests.cs (1)
76
public
ActionResult
<TestModel> InspectReturnExpression_SetsReturnType_WhenValueIsReturned()
TestFiles\ActualApiResponseMetadataFactoryTest\InspectReturnExpressionTestsForSwitchExpression.cs (1)
115
public
ActionResult
<TestModel> InspectReturnExpression_SetsReturnType_WhenValueIsReturned()
TestFiles\ActualApiResponseMetadataFactoryTest\TryGetActualResponseMetadataTests.cs (3)
11
public async Task<
ActionResult
<IEnumerable<TryGetActualResponseMetadataModel>>> ActionWithActionResultOfTReturningOkResult()
19
public async Task<
ActionResult
<IEnumerable<TryGetActualResponseMetadataModel>>> ActionWithActionResultOfTReturningModel()
27
public async Task<
ActionResult
<TryGetActualResponseMetadataModel>> ActionReturningNotFoundAndModel(int id)
TestFiles\AddResponseTypeAttributeCodeFixProviderIntegrationTest\CodeFixAddsSuccessStatusCode.Input.cs (1)
14
public
ActionResult
<object> GetItem(string id)
TestFiles\AddResponseTypeAttributeCodeFixProviderIntegrationTest\CodeFixAddsSuccessStatusCode.Output.cs (1)
19
public
ActionResult
<object> GetItem(string id)
TestFiles\AddResponseTypeAttributeCodeFixProviderIntegrationTest\CodeFixWithConventionAddsMissingStatusCodes.Input.cs (1)
14
public
ActionResult
<string> GetItem(int id)
TestFiles\AddResponseTypeAttributeCodeFixProviderIntegrationTest\CodeFixWithConventionAddsMissingStatusCodes.Output.cs (1)
18
public
ActionResult
<string> GetItem(int id)
TestFiles\AddResponseTypeAttributeCodeFixProviderIntegrationTest\CodeFixWithConventionMethodAddsMissingStatusCodes.Input.cs (1)
8
public
ActionResult
<string> GetItem(int id)
TestFiles\AddResponseTypeAttributeCodeFixProviderIntegrationTest\CodeFixWithConventionMethodAddsMissingStatusCodes.Output.cs (1)
12
public
ActionResult
<string> GetItem(int id)
TestFiles\AddResponseTypeAttributeCodeFixProviderIntegrationTest\CodeFixWorksWhenMultipleIdenticalStatusCodesAreInError.Input.cs (1)
16
public
ActionResult
<CodeFixWorksWhenMultipleIdenticalStatusCodesAreInErrorModel> GetItem(int id)
TestFiles\AddResponseTypeAttributeCodeFixProviderIntegrationTest\CodeFixWorksWhenMultipleIdenticalStatusCodesAreInError.Output.cs (1)
20
public
ActionResult
<CodeFixWorksWhenMultipleIdenticalStatusCodesAreInErrorModel> GetItem(int id)
TestFiles\ApiConventionAnalyzerIntegrationTest\DiagnosticsAreReturned_ForActionResultOfTReturningMethodWithoutAnyAttributes.cs (1)
14
public
ActionResult
<string> Method(Guid? id)
TestFiles\ApiConventionAnalyzerIntegrationTest\DiagnosticsAreReturned_IfMethodWithAttribute_ReturnsDerivedType.cs (1)
12
public
ActionResult
<DiagnosticsAreReturned_IfMethodWithAttribute_ReturnsDerivedTypeBaseModel> Method(int id)
TestFiles\ApiConventionAnalyzerIntegrationTest\DiagnosticsAreReturned_IfMethodWithAttributeAsynchronouslyReturnsValue_WithoutDocumentation.cs (1)
12
public async Task<
ActionResult
<DiagnosticsAreReturned_IfMethodWithAttributeAsynchronouslyReturnsValue_WithoutDocumentationModel>> Method(int id)
TestFiles\ApiConventionAnalyzerIntegrationTest\DiagnosticsAreReturned_IfMethodWithAttributeReturnsValue_WithoutDocumentation.cs (1)
10
public
ActionResult
<DiagnosticsAreReturned_IfMethodWithAttributeReturnsValue_WithoutDocumentationModel> Method(int id)
TestFiles\ApiConventionAnalyzerIntegrationTest\DiagnosticsAreReturned_IfMethodWithProducesResponseTypeAttribute_DoesNotDocumentSuccessStatusCode.cs (1)
13
public
ActionResult
<string> /*MM*/Method(int id)
TestFiles\ApiConventionAnalyzerIntegrationTest\NoDiagnosticsAreReturned_ForOkResultReturningAction.cs (1)
12
public async Task<
ActionResult
<IEnumerable<NoDiagnosticsAreReturned_ForOkResultReturningAction>>> Action()
TestFiles\SymbolApiResponseMetadataProviderTest\GetResponseMetadataTests.cs (2)
13
public
ActionResult
<Person> GetPerson(int id) => null;
15
public
ActionResult
<Person> PostPerson(Person person) => null;
Mvc.RoutingWebSite (2)
Controllers\ItemsController.cs (2)
11
public
ActionResult
<Dictionary<object, object>> Index()
22
public
ActionResult
<Dictionary<object, object>> IndexWithArgument(string arg)
XmlFormattersWebSite (4)
Controllers\XmlApiControllerBase.cs (4)
14
public
ActionResult
<Person> ActionReturningClientErrorStatusCodeResult()
18
public
ActionResult
<Person> ActionReturningProblemDetails()
33
public
ActionResult
<Person> ActionReturningValidationProblem([FromQuery] Address address)
37
public
ActionResult
<Person> ActionReturningValidationDetailsWithMetadata()