示例#1
0
        public IActionResult Index()
        {
            if (!User.Identity.IsAuthenticated)
            {
                return(RedirectToAction("Login", "Owners"));
            }
            ;

            int    userId = ControllerUtils.GetCurrentUserId(User);
            string role   = ControllerUtils.GetCurrentUserRole(User);

            if (role == "DogWalker")
            {
                //redirect to a walker page
            }
            if (role == "DogOwner")
            {
                return(RedirectToAction("Details", "Owners", new { id = userId }));
            }

            //THis lne should never execute
            return(RedirectToAction("Index", "Walkers"));
        }