Files
HomeMonitor/Weather/Service/Controllers/ValuesController.cs

31 lines
722 B
C#

using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
namespace Weather.Service.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class ValuesController : ControllerBase
{
[HttpGet]
public ActionResult<IEnumerable<string>> Get()
{
return new[] { "value1", "value2" };
}
[HttpGet("{id}")]
public ActionResult<string> Get(int id)
{
return "value";
}
[HttpPost]
public void Post([FromBody] string value) { }
[HttpPut("{id}")]
public void Put(int id, [FromBody] string value) { }
[HttpDelete("{id}")]
public void Delete(int id) { }
}
}