Exemplo n.º 1
0
        public IActionResult Index()
        {
            var roles = ((ClaimsIdentity)User.Identity).Claims
                        .Where(c => c.Type == ClaimTypes.Role)
                        .Select(c => c.Value).FirstOrDefault();

            if (roles == "Customer")
            {
                var customerId = ((ClaimsIdentity)User.Identity).Claims.First().Value;
                return(RedirectToAction("AllOrders", new { id = customerId }));
            }

            return(View(users.AllCustomer()));
        }
Exemplo n.º 2
0
        public IActionResult Contact()
        {
            if (User.IsInRole("Customer"))
            {
                return(View(users.AllEmployee()));
            }

            return(View(users.AllCustomer()));
        }