// GET: Person public ActionResult Index() { using (DAL.ApplicationContext vrlContext = new DAL.ApplicationContext()) { var vrlPersons = vrlContext.Persons.ToList(); return View(vrlPersons); } }
// GET: Person public ActionResult Index() { using (DAL.ApplicationContext vrlContext = new DAL.ApplicationContext()) { var vrlPersons = vrlContext.Persons.ToList(); return(View(vrlPersons)); } }
public TemplateModel() { if (HttpContext.Current.Request.IsAuthenticated) { var db = new DAL.ApplicationContext(); var userId = HttpContext.Current.User.Identity.GetUserId(); var user = db.Users.FirstOrDefault(u => u.Id == userId); user.PasswordHash = null; user.SecurityStamp = null; this.User = user; } }