Added projects page
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user