Beispiel #1
0
        public IActionResult ChangeHomeGym()
        {
            User               user  = _context.users.Include(u => u.gym).Where(u => u.UserID == _auth.User.UserID).FirstOrDefault();
            List <Gym>         gyms  = _context.gyms.ToList();
            ChangeGymViewModel model = new ChangeGymViewModel
            {
                user = user,
                gyms = gyms
            };

            return(View(model));
        }
        //Front Locations Page
        public IActionResult Index()
        {
            ChangeGymViewModel model = new ChangeGymViewModel()
            {
                gyms = _context.gyms.ToList()
            };

            if (_auth.User != null)
            {
                model.user = _auth.User;

                ViewData["Layout"] = "~/Views/Shared/_LayoutViewModelUser.cshtml";
                return(View(model));
            }


            return(View(model));
        }