feat: automatically run vite dev server when in Debugger mode. feat: supports hotreload on both js frontend and .net backend.
22 lines
562 B
C#
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);
|