"ConnectionStrings": {
"DefaultConnection": "User ID=postgres;Password=postgres;Host=localhost;Port=5432;Database=example;"
}
при попытке открыть сайт в логах выскакивает предупреждение -
100.0 % of the requests are failing with HTTP 5xx.
public class ComicProcessor
{
public static int MaxComicNumber { get; set; }
public static async Task<ComicModel> LoadComic(int comicNumber = 0)
{
string url = "";
if(comicNumber > 0)
{
url = $"https://xkcd.com/{comicNumber}/info.0.json";
}
else
{
url = "https://xkcd.com/info.0.json";
}
using (HttpResponseMessage response = await ApiHelper.ApiClient.GetAsync(url))
{
if (response.IsSuccessStatusCode)
{
ComicModel comic = await response.Content.ReadAsAsync<ComicModel>();
if(comicNumber == 0)
{
MaxComicNumber = comic.Num;
}
return comic;
}
else
{
throw new Exception(response.ReasonPhrase);
}
}
}
}
Изучить WPFна этом ресурсе - https://metanit.com/sharp/wpf/1.php