Files
lchen 5c81ed18b2 initial version.
feat: automatically run vite dev server when in Debugger mode.
feat: supports hotreload on both js frontend and .net backend.
2026-10-21 14:11:15 +08:00

22 lines
562 B
C#

using Microsoft.AspNetCore.Mvc;
namespace WebApplication1.Controllers;
[Route("api")]
[ApiController]
[ApiExceptionFilter]
public class ApiController : SiteControllerBase
{
[Route("detail")]
[HttpGet]
[ResponseCache(CacheProfileName = "NoCache")]
public ApiResult<DetailItem> 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);