hanyadikhetvan-dotnethf/HanyadikHetVan/Controllers/TestController.cs

30 lines
574 B
C#

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