using Expose.MyIT.Shared.Models.Stateless.Methods; using Expose.MyIT.Shared.ViewModels; using Microsoft.AspNetCore.Mvc; namespace Expose.MyIT.Server.Controllers; [ApiController] [Route("[controller]")] [Route("api/[controller]")] public class WeatherForecastController : ControllerBase, IWeatherForecastController { private static readonly string[] _Summaries = new[] { "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" }; private readonly ILogger _Logger; public WeatherForecastController(ILogger logger) => _Logger = logger; Task IWeatherForecastController.Get() => throw new NotImplementedException(); [HttpGet] public WeatherForecast[] Get() { _Logger.LogDebug("I was here :)"); return Enumerable.Range(1, 5).Select(index => new WeatherForecast(new Shared.Models.WeatherForecast { Date = DateOnly.FromDateTime(DateTime.Now.AddDays(index)), TemperatureC = Random.Shared.Next(-20, 55), Summary = _Summaries[Random.Shared.Next(_Summaries.Length)] })) .ToArray(); } }