add api controller
This commit is contained in:
parent
1238358272
commit
780ca056ec
16
WeatherDashboard.Web/Controllers/ApiController.cs
Normal file
16
WeatherDashboard.Web/Controllers/ApiController.cs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using WeatherDashboard.Web.Services;
|
||||||
|
|
||||||
|
namespace WeatherDashboard.Web.Controllers
|
||||||
|
{
|
||||||
|
[ApiController]
|
||||||
|
[Route("api")]
|
||||||
|
public class ApiController : Controller
|
||||||
|
{
|
||||||
|
private readonly IForecastService forecastService;
|
||||||
|
|
||||||
|
public ApiController(IForecastService forecastService) => this.forecastService = forecastService;
|
||||||
|
|
||||||
|
public Task<WeatherSet> Get() => forecastService.GetWeatherAsync();
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user