ActionResult<T> lets an ASP.NET Core action return either a successful typed value or an HTTP action result. For example, an action returning Task<ActionResult<RestDTO<Domain[]>>> can produce domain data when validation succeeds, or an ObjectResult containing validation details when it fails. section 6.2.3
Use the return type when an action must:
- Return a JSON object for a successful request. section 6.2.3
- Return different HTTP statuses, such as 501 for an unsupported page size or 400 for an invalid sort order. section 6.2.3
Verify both response paths
Call /Domains?pageSize=101 and /Domains?sortOrder=InvalidValue. Open the browser Network tab and inspect each HTTP status, not only the response body. section 6.2.3



