From 1dcbadf2eb928c63ce3a968f311f6af6b81d33a4 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 27 Mar 2017 18:57:07 -0400 Subject: Beginning of wiki development --- .../Controllers/WikiControllerController.cs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Project-Unite/Controllers/WikiControllerController.cs (limited to 'Project-Unite/Controllers/WikiControllerController.cs') diff --git a/Project-Unite/Controllers/WikiControllerController.cs b/Project-Unite/Controllers/WikiControllerController.cs new file mode 100644 index 0000000..1840074 --- /dev/null +++ b/Project-Unite/Controllers/WikiControllerController.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.Mvc; +using Project_Unite.Models; + +namespace Project_Unite.Controllers +{ + public class WikiController : Controller + { + public ActionResult Index(string id = "") + { + var db = new ApplicationDbContext(); + var model = new WikiViewModel(); + var wikicategories = db.WikiCategories.Where(x => x.Parent == null); + model.Categories = wikicategories; + model.Page = db.WikiPages.FirstOrDefault(x => x.Id == id); + return View(model); + } + } +} \ No newline at end of file -- cgit v1.2.3