using Microsoft.AspNetCore.Mvc; namespace WebApplication1.Controllers; [Route("api")] [ApiController] [ApiExceptionFilter] public class ApiController : SiteControllerBase { [Route("detail")] [HttpGet] [ResponseCache(CacheProfileName = "NoCache")] public ApiResult GetDetail(int id) { //throw new PermissionException(500, errorMessage: "test error1"); //throw new ApiException(12, "test api exception."); return new DetailItem(id, "Test title"); } } public record DetailItem(int Id, string Name);