summaryrefslogtreecommitdiff
path: root/Project-Unite/Controllers/ProfilesController.cs
blob: c77afda0c6b49d3e163e08e4d75eeebf41f21126 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Project_Unite.Models;

namespace Project_Unite.Controllers
{
    [Authorize]
    public class ProfilesController : Controller
    {
        // GET: Profiles
        public ActionResult Index()
        {
            return View();
        }

        public ActionResult ViewProfile(string id)
        {
            var db = new ApplicationDbContext();
            var user = db.Users.FirstOrDefault(x => x.DisplayName == id);
            if (user == null)
                return new HttpStatusCodeResult(404);

            return View(user);
        }
    }
}