feat: inicializar proyecto base web api. Cierra #1

This commit is contained in:
2026-03-06 12:04:37 -03:00
parent bd6ea393f5
commit 06432100b2
10 changed files with 594 additions and 4 deletions

View File

@@ -0,0 +1,25 @@
using Microsoft.AspNetCore.Mvc;
namespace ApiVersioningDemo.Api.Controllers;
[ApiController]
[Route("[controller]")]
public class WeatherForecastController : ControllerBase
{
private static readonly string[] Summaries =
[
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
];
[HttpGet(Name = "GetWeatherForecast")]
public IEnumerable<WeatherForecast> Get()
{
return Enumerable.Range(1, 5).Select(index => new WeatherForecast
{
Date = DateOnly.FromDateTime(DateTime.Now.AddDays(index)),
TemperatureC = Random.Shared.Next(-20, 55),
Summary = Summaries[Random.Shared.Next(Summaries.Length)]
})
.ToArray();
}
}