Esempio n. 1
0
        public ActionResult Index3()
        {
            var _entities = new Model.AppContext();
            var model     = _entities.Products.Include(c => c.Nutrient);

            return(View(model));
        }
Esempio n. 2
0
        public ActionResult Index2()
        {
            var _entities = new Model.AppContext();
            var model     = _entities.Products;

            return(View(model));
        }
Esempio n. 3
0
        public ApplicationUser CheckCurrentUser()
        {
            AppContext _entities     = new Model.AppContext();
            string     currentUserId = User.Identity.GetUserId();
            UserManager <ApplicationUser> manager = new UserManager <ApplicationUser>(new UserStore <ApplicationUser>(_entities));
            ApplicationUser currentUser           = manager.FindById(currentUserId);

            return(currentUser);
        }