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())); }
public IActionResult Contact() { if (User.IsInRole("Customer")) { return(View(users.AllEmployee())); } return(View(users.AllCustomer())); }