diff options
Diffstat (limited to 'Project-Unite/Controllers/ContestsController.cs')
| -rw-r--r-- | Project-Unite/Controllers/ContestsController.cs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Project-Unite/Controllers/ContestsController.cs b/Project-Unite/Controllers/ContestsController.cs index 8439008..4b41f91 100644 --- a/Project-Unite/Controllers/ContestsController.cs +++ b/Project-Unite/Controllers/ContestsController.cs @@ -7,13 +7,24 @@ using Project_Unite.Models; namespace Project_Unite.Controllers { + [Authorize] public class ContestsController : Controller { + [AllowAnonymous] // GET: Contests public ActionResult Index() { var model = new ApplicationDbContext().Contests.ToArray(); return View(model); } + + public ActionResult ViewContest(string id) + { + var db = new ApplicationDbContext(); + var c = db.Contests.FirstOrDefault(x => x.Id == id); + if (c == null) + return new HttpStatusCodeResult(404); + return View(c); + } } }
\ No newline at end of file |
