1
0
Files
2024-03-25 17:39:44 +08:00

29 lines
974 B
C#

using CoreProfilerExample.Common.Extensions;
using CoreProfilerExample.Repository.Interfaces;
using CoreProfilerExample.Service.Extensions;
using CoreProfilerExample.Service.Interfaces;
using CoreProfilerExample.Service.Models.Dtos;
using CoreProfilerExample.Service.Models.ParameterDtos;
using System.Reflection;
namespace CoreProfilerExample.Service.Implements
{
public class WeatherService : IWeatherService
{
public WeatherService(IWeatherForecastRepository weatherForecast)
{
this.weatherForecast = weatherForecast;
}
private readonly IWeatherForecastRepository weatherForecast = null!;
public Task<GetWeatherForecastDto> GetWeatherForecastAsync(GetWeatherForecastParameterDto parameterDto)
{
using (MethodBase.GetCurrentMethod()?.ProfilingStep())
{
return weatherForecast.GetAsync(parameterDto.ForecastDays).ToDtoAsync();
}
}
}
}