21 lines
564 B
C#
21 lines
564 B
C#
using System.Net.Http.Json;
|
|
using TIAMWebApp.Shared.Application.Interfaces;
|
|
using TIAMWebApp.Shared.Application.Models;
|
|
|
|
namespace TIAMWebApp.Client.Services
|
|
{
|
|
public class WeatherForecastService : IWeatherForecastService
|
|
{
|
|
private readonly HttpClient http;
|
|
|
|
public WeatherForecastService(HttpClient http)
|
|
{
|
|
this.http = http;
|
|
}
|
|
public Task<WeatherForecast[]?> GetWeatherForecastAsync()
|
|
{
|
|
return http.GetFromJsonAsync<WeatherForecast[]>(APIUrls.WeatherForecast);
|
|
}
|
|
}
|
|
}
|