summaryrefslogtreecommitdiff
path: root/Project-Unite/Controllers/ContestsController.cs
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-05-20 19:42:32 -0400
committerMichael <[email protected]>2017-05-20 19:42:32 -0400
commitb0c200196e5506b456895f9ee0c4c8dcd547fdb7 (patch)
tree05e04d50c950ca0dfedbc5058a0c9d928162f241 /Project-Unite/Controllers/ContestsController.cs
parent12a8540d72c7a3c84264e36b5a92b71c3bd1659a (diff)
downloadproject-unite-b0c200196e5506b456895f9ee0c4c8dcd547fdb7.tar.gz
project-unite-b0c200196e5506b456895f9ee0c4c8dcd547fdb7.tar.bz2
project-unite-b0c200196e5506b456895f9ee0c4c8dcd547fdb7.zip
viewcontest page
Diffstat (limited to 'Project-Unite/Controllers/ContestsController.cs')
-rw-r--r--Project-Unite/Controllers/ContestsController.cs11
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