1
0

Added projects page

This commit is contained in:
Michael Gordeev
2019-10-12 18:22:46 +03:00
parent 70276f5fd7
commit b4ce7c9288
19 changed files with 246 additions and 21 deletions
@@ -9,7 +9,6 @@ namespace MyWebsite.Controllers
{
public class GalleryController : Controller
{
public async Task<IActionResult> Index()
{
ViewData["Images"] = JsonConvert.DeserializeObject<Image[]>(await new HttpClient().GetStringAsync($"https://{Request.Host}/Gallery.json"));
@@ -1,16 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
namespace MyWebsite.Controllers
{
public class HelloWorldController : Controller
{
public string Index()
{
return "Hi there, bitch!";
}
}
}
@@ -0,0 +1,20 @@
using Microsoft.AspNetCore.Mvc;
using MyWebsite.Models;
using Newtonsoft.Json;
using System.Net.Http;
using System.Threading.Tasks;
namespace MyWebsite.Controllers
{
public class ProjectsController : Controller
{
public async Task<IActionResult> Index()
{
Project[] projects = JsonConvert.DeserializeObject<Project[]>(await new HttpClient().GetStringAsync($"https://{Request.Host}/Projects.json"));
ViewData["Images"] = projects;
return View();
}
}
}