22 lines
544 B
C#
22 lines
544 B
C#
using Microsoft.AspNetCore.Mvc;
|
|
using WeatherDashboard.Web.Services;
|
|
|
|
namespace WeatherDashboard.Web.Controllers
|
|
{
|
|
public class HomeController : Controller
|
|
{
|
|
private readonly IForecastService forecastService;
|
|
|
|
public HomeController(IForecastService forecastService)
|
|
{
|
|
this.forecastService = forecastService;
|
|
}
|
|
|
|
public async Task<IActionResult> Index()
|
|
{
|
|
var weather = await forecastService.GetWeatherAsync();
|
|
|
|
return View(weather);
|
|
}
|
|
}
|
|
} |