-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
9 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
using HandlenettAPI.Models; | ||
using Newtonsoft.Json.Linq; | ||
using StackExchange.Redis; | ||
using System.Configuration; | ||
using System.Text.Json; | ||
|
||
namespace HandlenettAPI.Services | ||
|
@@ -15,7 +16,9 @@ public WeatherService(HttpClient httpClient, IConfiguration config) | |
{ | ||
_httpClient = httpClient; | ||
_httpClient.DefaultRequestHeaders.Add("User-Agent", "Miles Haugesund Handlenett/1.0 ([email protected])"); | ||
_redis = ConnectionMultiplexer.Connect(config.GetConnectionString("AzureRedisCache")); | ||
var redisConnString = config.GetConnectionString("AzureRedisCache") ?? throw new ConfigurationErrorsException("Missing redis config"); | ||
_redis = ConnectionMultiplexer.Connect(redisConnString); | ||
|
||
} | ||
|
||
public async Task<Weather> GetWeatherByCoordinatesAsync(double latitude, double longitude) | ||
|