public IActionResult Index() { string UserName = string.Empty; var identity = (ClaimsIdentity)User.Identity; ViewBag.data = TempData["data"]; if (identity.Name != null) { UserName = identity.Name; } UserModel user = adHelper.GetUserDetails(UserName); return(View(user)); }