IActionResult là interface cho tất cả action return types. ActionResult là implementation non-generic. ActionResult<T> cho phép trả về cả typed response thành công lẫn error results.
- Các implementation phổ biến:
OkObjectResult(200),NotFoundResult(404),BadRequestResult(400),CreatedAtActionResult(201). - Dùng
ActionResult<T>trong Web API để đặc tả rõ kiểu trả về.