public WeatherServiceProvider( IMapper mapper, ApplicationDbContext context, IConfiguration config, IOpenWeatherMapApiService apiService, IOptions <ApiOptions> options ) { _ = options ?? throw new NullReferenceException(nameof(options)); _ = context ?? throw new ArgumentNullException(nameof(context)); _ = apiService ?? throw new ArgumentNullException(nameof(apiService)); _ = mapper ?? throw new ArgumentNullException(nameof(mapper)); _options = options.Value; _context = context; _apiService = apiService; _mapper = mapper; }
public GetForecastByCityNameHandler(IOpenWeatherMapApiService openWeatherMapApiService, IUserSearchRepository userSearchRepository, IMemoryCache cache) { _openWeatherMapApiService = openWeatherMapApiService; _userSearchRepository = userSearchRepository; _cache = cache; }
public void Initialize() { _openWeatherMapService = new OpenWeatherMapApiService( _configuration["OpenWeatherMap.ApiKey"]); }