hanyadikhetvan-dotnethf/HanyadikHetVan/Controllers/TestController.cs

26 lines
487 B
C#

using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace HanyadikHetVan.Controllers
{
[Route("api/test")]
[ApiController]
public class TestController : ControllerBase
{
[HttpGet("unprotected")]
public string Unprotected()
{
return "Unprotected";
}
[Authorize]
[HttpGet("protected")]
public string Protected()
{
return "Protected";
}
}
}