yavsc/Yavsc/Controllers/ValuesController.cs

26 lines
601 B
C#
Raw Normal View History

2016-06-07 22:00:10 +02:00
using System.Collections.Generic;
2016-06-06 12:38:11 +02:00
using Microsoft.AspNet.Mvc;
using Microsoft.AspNet.Authorization;
namespace Yavsc.Controllers
{
[Route("api/[controller]")]
public class ValuesController : Controller
{
// GET: api/values
[HttpGet]
public IEnumerable<string> Get()
{
//throw new Exception("Horsed");
return new string[] { "value1", "value2" };
}
// GET api/values/5
[HttpGet("{id}")]
[Authorize("Bearer")]
public string Get(int id)
{
return "value";
}
}
}