12 types derived from ObjectResult
Microsoft.AspNetCore.Mvc.Core (12)
AcceptedAtActionResult.cs (1)
17public class AcceptedAtActionResult : ObjectResult
AcceptedAtRouteResult.cs (1)
17public class AcceptedAtRouteResult : ObjectResult
AcceptedResult.cs (1)
13public class AcceptedResult : ObjectResult
BadRequestObjectResult.cs (1)
14public class BadRequestObjectResult : ObjectResult
ConflictObjectResult.cs (1)
14public class ConflictObjectResult : ObjectResult
CreatedAtActionResult.cs (1)
17public class CreatedAtActionResult : ObjectResult
CreatedAtRouteResult.cs (1)
17public class CreatedAtRouteResult : ObjectResult
CreatedResult.cs (1)
13public class CreatedResult : ObjectResult
NotFoundObjectResult.cs (1)
13public class NotFoundObjectResult : ObjectResult
OkObjectResult.cs (1)
14public class OkObjectResult : ObjectResult
UnauthorizedObjectResult.cs (1)
13public class UnauthorizedObjectResult : ObjectResult
UnprocessableEntityObjectResult.cs (1)
14public class UnprocessableEntityObjectResult : ObjectResult
66 instantiations of ObjectResult
ApiExplorerWebSite (2)
Controllers\ApiExplorerResponseTypeWithoutAttributeController.cs (2)
31return new ObjectResult(null); 70return Task.FromResult(new ObjectResult(null));
BasicWebSite (11)
Controllers\ActionConstraints\ConsumesAttribute_OveridesBaseController.cs (1)
24return new ObjectResult(product);
Controllers\ContentNegotiation\ContentNegotiationController.cs (2)
24return new ObjectResult(CreateUser()); 30return new ObjectResult(CreateUser());
Controllers\ContentNegotiation\FallbackOnTypeBasedMatchController.cs (5)
29var objectResult = new ObjectResult(input); 43var objectResult = new ObjectResult(input); 54var objectResult = new ObjectResult(input); 63var objectResult = new ObjectResult(input); 75var objectResult = new ObjectResult("Hello World!");
Filters\TraceOutputResultFilter.cs (1)
14context.Result = new ObjectResult(trace);
Filters\UnprocessableResultFilter.cs (1)
20context.Result = new ObjectResult("Can't process this!")
RequestScopedFilter.cs (1)
25context.Result = new ObjectResult(_requestIdService.RequestId);
FormatterWebSite (3)
Controllers\DoNotRespectBrowserAcceptHeaderController.cs (1)
39return new ObjectResult(employee);
Controllers\JsonFormatterController.cs (1)
41var objectResult = new ObjectResult(user);
ValidateBodyParameterAttribute.cs (1)
36context.Result = new ObjectResult(errorInfo);
Microsoft.AspNetCore.Mvc.Core (7)
ActionResultOfT.cs (1)
95return new ObjectResult(Value)
ControllerBase.cs (3)
231return new ObjectResult(value) 1898return new ObjectResult(problemDetails) 2027return new ObjectResult(validationProblem)
DependencyInjection\ApiBehaviorOptionsSetup.cs (1)
41result = new ObjectResult(problemDetails)
Infrastructure\ActionResultTypeMapper.cs (1)
39return new ObjectResult(value)
Infrastructure\ProblemDetailsClientErrorFactory.cs (1)
19return new ObjectResult(problemDetails)
Microsoft.AspNetCore.Mvc.Core.Test (26)
Formatters\FormatFilterTest.cs (4)
81new ObjectResult("Hello!"), 331var objectResult = new ObjectResult("Hello!"); 371new ObjectResult("Hello!"), 422new ObjectResult("Some Value"),
Infrastructure\ObjectResultExecutorTest.cs (17)
29var result = new ObjectResult("input") 57var result = new ObjectResult("input"); 80var result = new ObjectResult("input"); 102var result = new ObjectResult("input"); 122var result = new ObjectResult(new ProblemDetails()) 147var result = new ObjectResult(new ProblemDetails()); 169var result = new ObjectResult(new ProblemDetails()); 192var result = new ObjectResult(new ProblemDetails()) 217var result = new ObjectResult(new ProblemDetails()) 241var result = new ObjectResult(new ProblemDetails()); 264var result = new ObjectResult("input"); 293var result = new ObjectResult("someValue"); 315var result = new ObjectResult("some value"); 335var result = new ObjectResult("input"); 381var result = new ObjectResult("input"); 418var result = new ObjectResult("input"); 441var result = new ObjectResult(value: null);
ObjectResultTests.cs (4)
24var result = new ObjectResult(input); 38var result = new ObjectResult("Hello") 70var result = new ObjectResult(details) 100var result = new ObjectResult(details)
ProducesAttributeTests.cs (1)
187new ObjectResult("Some Value"),
Microsoft.AspNetCore.Mvc.RazorPages (2)
PageBase.cs (1)
1156=> new ObjectResult(value) { StatusCode = statusCode };
PageModel.cs (1)
1509return new ObjectResult(value)
Mvc.Api.Analyzers.Test (10)
TestFiles\ActualApiResponseMetadataFactoryTest\InspectReturnExpressionTests.cs (1)
22return new ObjectResult(new object()) { StatusCode = 201 };
TestFiles\ActualApiResponseMetadataFactoryTest\InspectReturnExpressionTestsForSwitchExpression.cs (1)
30_ => new ObjectResult(new object()) { StatusCode = 201 }
TestFiles\AddResponseTypeAttributeCodeFixProviderIntegrationTest\CodeFixAddsStatusCodesFromObjectInitializer.Input.cs (4)
18return new ObjectResult(new object()) 26return new ObjectResult(new object()) 36return new ObjectResult(new object()) 44return new ObjectResult(new object())
TestFiles\AddResponseTypeAttributeCodeFixProviderIntegrationTest\CodeFixAddsStatusCodesFromObjectInitializer.Output.cs (4)
24return new ObjectResult(new object()) 32return new ObjectResult(new object()) 42return new ObjectResult(new object()) 50return new ObjectResult(new object())
Negotiate.Server (2)
Controllers\AuthController.cs (2)
18return new ObjectResult(new 31return new ObjectResult(new
XmlFormattersWebSite (3)
Controllers\HomeController.cs (1)
17return new ObjectResult(GetModelStateErrorMessages(ModelState))
Controllers\SerializableErrorController.cs (1)
28return new ObjectResult(new SerializableError(ModelState));
Controllers\ValidationController.cs (1)
16return new ObjectResult(new ModelBindingInfo()
207 references to ObjectResult
ApiExplorerWebSite (2)
Controllers\ApiExplorerResponseTypeWithoutAttributeController.cs (2)
29public ObjectResult GetDerivedActionResult() 68public Task<ObjectResult> GetTaskOfDerivedActionResult()
BasicWebSite (19)
Controllers\ContentNegotiation\FallbackOnTypeBasedMatchController.cs (5)
29var objectResult = new ObjectResult(input); 43var objectResult = new ObjectResult(input); 54var objectResult = new ObjectResult(input); 63var objectResult = new ObjectResult(input); 75var objectResult = new ObjectResult("Hello World!");
Controllers\ContentNegotiation\FormatFilterController.cs (2)
31var result = context.Result as ObjectResult;
Controllers\ContentNegotiation\NoContentDoNotTreatNullValueAsNoContentController.cs (2)
14var result = context.Result as ObjectResult;
Controllers\ContentNegotiation\NoProducesContentOnClassController.cs (2)
14var result = context.Result as ObjectResult;
Controllers\ContentNegotiation\NormalController.cs (2)
33var result = context.Result as ObjectResult;
Controllers\ContentNegotiation\ProducesContentBaseController.cs (2)
15var result = context.Result as ObjectResult;
Controllers\ContentNegotiation\ProducesContentOnClassController.cs (2)
15var result = context.Result as ObjectResult;
Controllers\ContentNegotiation\ProducesWithMediaTypeParametersController.cs (2)
15var result = context.Result as ObjectResult;
FormatterWebSite (5)
Controllers\DataContractSerializerController.cs (2)
17var result = context.Result as ObjectResult;
Controllers\JsonFormatterController.cs (1)
41var objectResult = new ObjectResult(user);
Controllers\XmlSerializerController.cs (2)
14var result = context.Result as ObjectResult;
Microsoft.AspNetCore.Mvc.Core (42)
ApiBehaviorOptions.cs (3)
72/// <see cref="ProblemDetails"/> instance (returned as the value for <see cref="ObjectResult"/>). 86/// are used to transform <see cref="IClientErrorActionResult"/> to an <see cref="ObjectResult"/> 87/// instance where the <see cref="ObjectResult.Value"/> is <see cref="ProblemDetails"/>.
BadRequestObjectResult.cs (1)
11/// An <see cref="ObjectResult"/> that when executed will produce a Bad Request (400) response.
ConflictObjectResult.cs (1)
11/// An <see cref="ObjectResult"/> that when executed will produce a Conflict (409) response.
ControllerBase.cs (10)
223/// Creates an <see cref="ObjectResult"/> object by specifying a <paramref name="statusCode"/> and <paramref name="value"/> 226/// <param name="value">The value to set on the <see cref="ObjectResult"/>.</param> 227/// <returns>The created <see cref="ObjectResult"/> object for the response.</returns> 229public virtual ObjectResult StatusCode([ActionResultStatusCode] int statusCode, [ActionResultObjectValue] object? value) 1829/// Creates an <see cref="ObjectResult"/> that produces a <see cref="ProblemDetails"/> response. 1836/// <returns>The created <see cref="ObjectResult"/> for the response.</returns> 1839public virtual ObjectResult Problem( 1848/// Creates an <see cref="ObjectResult"/> that produces a <see cref="ProblemDetails"/> response. 1856/// <returns>The created <see cref="ObjectResult"/> for the response.</returns> 1858public virtual ObjectResult Problem(
DependencyInjection\ApiBehaviorOptionsSetup.cs (1)
33ObjectResult result;
DependencyInjection\MvcCoreServiceCollectionExtensions.cs (1)
235services.TryAddSingleton<IActionResultExecutor<ObjectResult>, ObjectResultExecutor>();
FormatFilterAttribute.cs (1)
12/// <see cref="ObjectResult" /> returned from an action.
Formatters\FormatFilter.cs (3)
15/// <see cref="ObjectResult"/> returned from an action. 129/// Sets a Content Type on an <see cref="ObjectResult" /> using a format value from the request. 143if (context.Result is not ObjectResult objectResult)
Infrastructure\DefaultOutputFormatterSelector.cs (1)
277nameof(ObjectResult.ContentTypes));
Infrastructure\ObjectResultExecutor.cs (9)
16/// Executes an <see cref="ObjectResult"/> to write to the response. 18public partial class ObjectResultExecutor : IActionResultExecutor<ObjectResult> 58/// Executes the <see cref="ObjectResult"/>. 61/// <param name="result">The <see cref="ObjectResult"/>.</param> 63/// A <see cref="Task"/> which will complete once the <see cref="ObjectResult"/> is written to the response. 65public virtual Task ExecuteAsync(ActionContext context, ObjectResult result) 83private Task ExecuteAsyncCore(ActionContext context, ObjectResult result, Type? objectType, object? value) 122private static void InferContentTypes(ActionContext context, ObjectResult result) 147public static void ObjectResultExecuting(ILogger logger, ObjectResult result, object? value)
Infrastructure\OutputFormatterSelector.cs (1)
16/// of <see cref="ObjectResult"/>.
MvcOptions.cs (1)
364/// When <see cref="ObjectResult.Value" /> is an instance of <see cref="IAsyncEnumerable{T}"/>,
NotFoundObjectResult.cs (1)
10/// An <see cref="ObjectResult"/> that when executed will produce a Not Found (404) response.
ObjectResult.cs (2)
19/// Creates a new <see cref="ObjectResult"/> instance with the provided <paramref name="value"/>. 62var executor = context.HttpContext.RequestServices.GetRequiredService<IActionResultExecutor<ObjectResult>>();
OkObjectResult.cs (1)
10/// An <see cref="ObjectResult"/> that when executed performs content negotiation, formats the entity body, and
ProducesAttribute.cs (3)
16/// <see cref="ObjectResult.ContentTypes"/>. 59/// Gets or sets the supported response content types. Used to set <see cref="ObjectResult.ContentTypes"/>. 74if (context.Result is ObjectResult objectResult)
UnauthorizedObjectResult.cs (1)
10/// An <see cref="ObjectResult"/> that when executed will produce a Unauthorized (401) response.
UnprocessableEntityObjectResult.cs (1)
11/// An <see cref="ObjectResult"/> that when executed will produce a Unprocessable Entity (422) response.
Microsoft.AspNetCore.Mvc.Core.Test (114)
AcceptedAtActionResultTests.cs (1)
271services.AddSingleton<IActionResultExecutor<ObjectResult>>(new ObjectResultExecutor(
AcceptedAtRouteResultTests.cs (1)
179services.AddSingleton<IActionResultExecutor<ObjectResult>>(new ObjectResultExecutor(
AcceptedResultTests.cs (1)
136services.AddSingleton<IActionResultExecutor<ObjectResult>>(new ObjectResultExecutor(
ActionResultOfTTest.cs (6)
71var objectResult = Assert.IsType<ObjectResult>(result); 89var objectResult = Assert.IsType<ObjectResult>(result); 107var objectResult = Assert.IsType<ObjectResult>(result);
ControllerBaseTest.cs (18)
2295var result = (ObjectResult)statusCodeController.StatusCode_Object(statusCode, value); 2312var result = statusCodeController.StatusCode_Object(statusCode, value); 2405var objectResult = Assert.IsType<ObjectResult>(actionResult); 2471var actionResult = controller.Problem(); 2474var badRequestResult = Assert.IsType<ObjectResult>(actionResult); 2497var actionResult = controller.Problem(detail, title: title); 2500var badRequestResult = Assert.IsType<ObjectResult>(actionResult); 2521var actionResult = controller.Problem(extensions: new Dictionary<string, object> { { "ext1", 1 }, { "ext2", 2 } }); 2524var badRequestResult = Assert.IsType<ObjectResult>(actionResult); 2542var actionResult = controller.Problem(statusCode: 422); 2545var badRequestResult = Assert.IsType<ObjectResult>(actionResult); 3286public ObjectResult StatusCode_Object(int statusCode, object value)
CreatedAtActionResultTests.cs (1)
91services.AddSingleton<IActionResultExecutor<ObjectResult>>(new ObjectResultExecutor(
CreatedAtRouteResultTests.cs (1)
105services.AddSingleton<IActionResultExecutor<ObjectResult>>(new ObjectResultExecutor(
CreatedResultTests.cs (1)
138services.AddSingleton<IActionResultExecutor<ObjectResult>>(new ObjectResultExecutor(
DependencyInjection\ApiBehaviorOptionsSetupTest.cs (2)
86var objectResult = Assert.IsType<ObjectResult>(result);
Formatters\FormatFilterTest.cs (11)
52var objectResult = Assert.IsType<ObjectResult>(resultExecutingContext.Result); 96var objectResult = Assert.IsType<ObjectResult>(resultExecutingContext.Result); 128var objectResult = Assert.IsType<ObjectResult>(resultExecutingContext.Result); 331var objectResult = new ObjectResult("Hello!"); 351var result = Assert.IsType<ObjectResult>(resultExecutingContext.Result); 386var result = Assert.IsType<ObjectResult>(resultExecutingContext.Result);
HttpNotFoundObjectResultTest.cs (1)
71services.AddSingleton<IActionResultExecutor<ObjectResult>>(new ObjectResultExecutor(
HttpOkObjectResultTest.cs (1)
73services.AddSingleton<IActionResultExecutor<ObjectResult>>(new ObjectResultExecutor(
Infrastructure\ActionMethodExecutorTest.cs (12)
110var result = Assert.IsType<ObjectResult>(await valueTask); 139var result = Assert.IsType<ObjectResult>(await valueTask); 168var result = Assert.IsType<ObjectResult>(await valueTask); 325var result = Assert.IsType<ObjectResult>(await valueTask); 354var result = Assert.IsType<ObjectResult>(await valueTask); 408var result = Assert.IsType<ObjectResult>(await valueTask);
Infrastructure\ActionResultTypeMapperTest.cs (2)
70var objectResult = Assert.IsType<ObjectResult>(result);
Infrastructure\ControllerActionInvokerTest.cs (19)
899var contentResult = Assert.IsType<ObjectResult>(result); 994var contentResult = Assert.IsType<ObjectResult>(result); 1044var contentResult = Assert.IsType<ObjectResult>(result); 1071var contentResult = Assert.IsType<ObjectResult>(result); 1097var contentResult = Assert.IsType<ObjectResult>(result); 1124var contentResult = Assert.IsType<ObjectResult>(result); 1181Assert.IsType<ObjectResult>(result); 1182Assert.IsType<int>(((ObjectResult)result).Value); 1183Assert.Equal(1, ((ObjectResult)result).Value); 1290var contentResult = Assert.IsType<ObjectResult>(result); 1710services.AddSingleton<IActionResultExecutor<ObjectResult>>(new ObjectResultExecutor( 1787public ObjectResult ThrowingActionMethod()
Infrastructure\ObjectResultExecutorTest.cs (17)
29var result = new ObjectResult("input") 57var result = new ObjectResult("input"); 80var result = new ObjectResult("input"); 102var result = new ObjectResult("input"); 122var result = new ObjectResult(new ProblemDetails()) 147var result = new ObjectResult(new ProblemDetails()); 169var result = new ObjectResult(new ProblemDetails()); 192var result = new ObjectResult(new ProblemDetails()) 217var result = new ObjectResult(new ProblemDetails()) 241var result = new ObjectResult(new ProblemDetails()); 264var result = new ObjectResult("input"); 293var result = new ObjectResult("someValue"); 315var result = new ObjectResult("some value"); 335var result = new ObjectResult("input"); 381var result = new ObjectResult("input"); 418var result = new ObjectResult("input"); 441var result = new ObjectResult(value: null);
Infrastructure\ProblemDetalsClientErrorFactoryTest.cs (8)
30var objectResult = Assert.IsType<ObjectResult>(result); 57var objectResult = Assert.IsType<ObjectResult>(result); 87var objectResult = Assert.IsType<ObjectResult>(result); 113var objectResult = Assert.IsType<ObjectResult>(result);
ObjectResultTests.cs (5)
24var result = new ObjectResult(input); 38var result = new ObjectResult("Hello") 70var result = new ObjectResult(details) 100var result = new ObjectResult(details) 160services.AddSingleton<IActionResultExecutor<ObjectResult>>(new ObjectResultExecutor(
ProducesAttributeTests.cs (6)
31var objectResult = resultExecutingContext.Result as ObjectResult; 58var objectResult = Assert.IsType<ObjectResult>(resultExecutingContext.Result); 83var objectResult = Assert.IsType<ObjectResult>(resultExecutingContext.Result);
Microsoft.AspNetCore.Mvc.RazorPages (8)
PageBase.cs (4)
1150/// Creates a <see cref="ObjectResult"/> object by specifying a <paramref name="statusCode"/> and <paramref name="value"/> 1153/// <param name="value">The value to set on the <see cref="ObjectResult"/>.</param> 1154/// <returns>The created <see cref="ObjectResult"/> object for the response.</returns> 1155public virtual ObjectResult StatusCode(int statusCode, object value)
PageModel.cs (4)
1502/// Creates a <see cref="ObjectResult"/> object by specifying a <paramref name="statusCode"/> and <paramref name="value"/> 1505/// <param name="value">The value to set on the <see cref="ObjectResult"/>.</param> 1506/// <returns>The created <see cref="ObjectResult"/> object for the response.</returns> 1507public virtual ObjectResult StatusCode(int statusCode, object value)
Microsoft.AspNetCore.Mvc.RazorPages.Test (8)
PageModelTest.cs (4)
1680var result = (ObjectResult)statusCodeController.StatusCode_Object(statusCode, value); 1697var result = statusCodeController.StatusCode_Object(statusCode, value); 2075public ObjectResult StatusCode_Object(int statusCode, object value)
PageTest.cs (4)
1670var result = (ObjectResult)statusCodePage.StatusCode_Object(statusCode, value); 1687var result = statusCodePage.StatusCode_Object(statusCode, value); 1928public ObjectResult StatusCode_Object(int statusCode, object value)
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (5)
ControllerUnitTestabilityTests.cs (5)
690var result = controller.Problem(detail); 693var badRequest = Assert.IsType<ObjectResult>(result); 710var badRequest = Assert.IsType<ObjectResult>(result);
Negotiate.Server (2)
Controllers\AuthController.cs (2)
15public ObjectResult GetUnrestricted() 28public ObjectResult GetAuthorized()
XmlFormattersWebSite (2)
Controllers\XmlDataContractApiController.cs (1)
18if (!(context.Result is ObjectResult objectResult))
Controllers\XmlSerializedApiController.cs (1)
18if (!(context.Result is ObjectResult objectResult))