diff --git a/MyWebsite/MyWebsite/Controllers/CVController.cs b/MyWebsite/MyWebsite/Controllers/CVController.cs index e7df979..a1bae37 100644 --- a/MyWebsite/MyWebsite/Controllers/CVController.cs +++ b/MyWebsite/MyWebsite/Controllers/CVController.cs @@ -13,7 +13,7 @@ namespace MyWebsite.Controllers HtmlToPdf converter = new HtmlToPdf(); converter.Options.MarginTop = 25; converter.Options.MarginBottom = 25; - PdfDocument doc = converter.ConvertUrl($"https://{Request.Host}/CV/PrintCV?pdfPreview=true"); + PdfDocument doc = converter.ConvertUrl($"{Request.Scheme}://{Request.Host}/CV/PrintCV?pdfPreview=true"); byte[] data = doc.Save(); doc.Close(); return File(data, "application/pdf", "[Michael Gordeev] CV.pdf"); diff --git a/MyWebsite/MyWebsite/Controllers/ContactsController.cs b/MyWebsite/MyWebsite/Controllers/ContactsController.cs index c0fbcf6..e4a2864 100644 --- a/MyWebsite/MyWebsite/Controllers/ContactsController.cs +++ b/MyWebsite/MyWebsite/Controllers/ContactsController.cs @@ -11,7 +11,7 @@ namespace MyWebsite.Controllers { public IActionResult Index() { - Dictionary links = JsonConvert.DeserializeObject>(new WebClient().DownloadString($"https://{Request.Host}/Links.json")); + Dictionary links = JsonConvert.DeserializeObject>(new WebClient().DownloadString($"{Request.Scheme}://{Request.Host}/Links.json")); ViewData["contactLinks"] = links.Values.ToList().FindAll(i => i.CanContactMe); ViewData["otherLinks"] = links.Values.ToList().FindAll(i => !i.CanContactMe); diff --git a/MyWebsite/MyWebsite/Controllers/GalleryController.cs b/MyWebsite/MyWebsite/Controllers/GalleryController.cs index 0aed5dd..6cbc932 100644 --- a/MyWebsite/MyWebsite/Controllers/GalleryController.cs +++ b/MyWebsite/MyWebsite/Controllers/GalleryController.cs @@ -12,7 +12,7 @@ namespace MyWebsite.Controllers [HttpGet("Arts")] public async Task Index() { - ViewData["Images"] = JsonConvert.DeserializeObject(await new HttpClient().GetStringAsync($"https://{Request.Host}/Gallery.json")); + ViewData["Images"] = JsonConvert.DeserializeObject(await new HttpClient().GetStringAsync($"{Request.Scheme}://{Request.Host}/Gallery.json")); return View(); } diff --git a/MyWebsite/MyWebsite/Controllers/HomeController.cs b/MyWebsite/MyWebsite/Controllers/HomeController.cs index 4c0e5f8..d8c6b93 100644 --- a/MyWebsite/MyWebsite/Controllers/HomeController.cs +++ b/MyWebsite/MyWebsite/Controllers/HomeController.cs @@ -1,8 +1,6 @@ -using System.Collections.Generic; -using System.Diagnostics; +using System.Diagnostics; using Microsoft.AspNetCore.Mvc; using MyWebsite.Models; -using Newtonsoft.Json; namespace MyWebsite.Controllers { diff --git a/MyWebsite/MyWebsite/Controllers/ProjectsController.cs b/MyWebsite/MyWebsite/Controllers/ProjectsController.cs index b75efbc..1bf39e2 100644 --- a/MyWebsite/MyWebsite/Controllers/ProjectsController.cs +++ b/MyWebsite/MyWebsite/Controllers/ProjectsController.cs @@ -10,7 +10,7 @@ namespace MyWebsite.Controllers { public async Task Index() { - Project[] projects = JsonConvert.DeserializeObject(await new HttpClient().GetStringAsync($"https://{Request.Host}/Projects.json")); + Project[] projects = JsonConvert.DeserializeObject(await new HttpClient().GetStringAsync($"{Request.Scheme}://{Request.Host}/Projects.json")); ViewData["Images"] = projects; diff --git a/MyWebsite/MyWebsite/Views/Shared/ContactsBlock.cshtml b/MyWebsite/MyWebsite/Views/Shared/ContactsBlock.cshtml index 68b51e4..862d1c5 100644 --- a/MyWebsite/MyWebsite/Views/Shared/ContactsBlock.cshtml +++ b/MyWebsite/MyWebsite/Views/Shared/ContactsBlock.cshtml @@ -1,4 +1,10 @@ -
+@using Newtonsoft.Json +@using System.Net +@{ + Dictionary links = JsonConvert.DeserializeObject>(new WebClient().DownloadString($"{Context.Request.Scheme}://{Context.Request.Host}/Links.json")); +} + +
if (You.InsterestedInMe)
ContactMe();
@@ -9,10 +15,10 @@ string email = "mihcael.xfox@outlook.com";
Link[] socialNetworks = new Link[]
{
- new Link("LinkedIn", "https://linkedin.com/xfox"),
- new Link("GitHub", "https://github.com/xfox111"),
- new Link("Twitter", "https://twitter.com/xfox111"),
- new Link("Vkontakte", "https://vk.com/xfox.mike")
+ new Link("LinkedIn", "https:@(links["linkedin"].Url)"),
+ new Link("GitHub", "https:@(links["github"].Url)"),
+ new Link("Twitter", "https:@(links["twitter"].Url)"),
+ new Link("Vkontakte", "https:@(links["vk"].Url)")
}
}

diff --git a/MyWebsite/MyWebsite/Views/Shared/_Layout.cshtml b/MyWebsite/MyWebsite/Views/Shared/_Layout.cshtml index 137d996..d345bfb 100644 --- a/MyWebsite/MyWebsite/Views/Shared/_Layout.cshtml +++ b/MyWebsite/MyWebsite/Views/Shared/_Layout.cshtml @@ -1,7 +1,8 @@ @using Newtonsoft.Json @using System.Net +@using System.Web @{ - Dictionary links = JsonConvert.DeserializeObject>(new WebClient().DownloadString("Links.json")); + Dictionary links = JsonConvert.DeserializeObject>(new WebClient().DownloadString($"{Context.Request.Scheme}://{Context.Request.Host}/Links.json")); }