29 lines
974 B
C#
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();
|
|
}
|
|
}
|
|
}
|
|
}
|