Addes News MVC.

This commit is contained in:
2018-04-13 02:42:27 +01:00
parent 42b2e0e9c7
commit 28267271f4
7 changed files with 168 additions and 8 deletions

View File

@@ -30,15 +30,24 @@
using System.Diagnostics;
using cicm_web.Models;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
namespace cicm_web.Controllers
{
public class HomeController : Controller
{
readonly IHostingEnvironment hostingEnvironment;
public HomeController(IHostingEnvironment env)
{
hostingEnvironment = env;
}
public IActionResult Index()
{
return View();
ViewBag.WebRootPath = hostingEnvironment.WebRootPath;
return View(News.GetLastItems());
}
public IActionResult About()