WeatherDashboard/WeatherDashboard.Web/Controllers/HomeController.cs

19 lines
515 B
C#
Raw Permalink Normal View History

2023-02-09 02:30:14 +00:00
using Microsoft.AspNetCore.Mvc;
2023-02-10 03:33:02 +00:00
using WeatherDashboard.Web.Services;
2023-02-09 02:30:14 +00:00
namespace WeatherDashboard.Web.Controllers
{
public class HomeController : Controller
{
2023-02-10 03:33:02 +00:00
private readonly IForecastService forecastService;
2023-02-09 02:30:14 +00:00
2023-03-19 02:27:34 +00:00
public HomeController(IForecastService forecastService) => this.forecastService = forecastService;
2023-02-09 02:30:14 +00:00
2023-02-10 03:33:02 +00:00
public async Task<IActionResult> Index()
2023-02-09 02:30:14 +00:00
{
2023-02-10 03:33:02 +00:00
var weather = await forecastService.GetWeatherAsync();
return View(weather);
2023-02-09 02:30:14 +00:00
}
}
}