21 lines
588 B
C#
21 lines
588 B
C#
|
|
using Avalonia_Services.Models;
|
||
|
|
using Avalonia_Services.Services;
|
||
|
|
using Microsoft.AspNetCore.Mvc;
|
||
|
|
|
||
|
|
namespace Avalonia_API.Controllers
|
||
|
|
{
|
||
|
|
[ApiController]
|
||
|
|
[Route("[controller]")]
|
||
|
|
public class WeatherForecastController(WeatherForecastService weatherForecastService) : ControllerBase
|
||
|
|
{
|
||
|
|
|
||
|
|
private readonly WeatherForecastService _weatherForecastService = weatherForecastService;
|
||
|
|
|
||
|
|
[HttpGet(Name = "GetWeatherForecast")]
|
||
|
|
public IEnumerable<WeatherForecast> Get()
|
||
|
|
{
|
||
|
|
return _weatherForecastService.GetWeatherForecasts();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|