public IActionResult Queries() { try { int uid = Convert.ToInt32(HttpContext.Session.GetString("uid")); if (uid == 0) { return(RedirectToAction("Login", "Home")); } if (_repObj.GetRoleId(uid) != "E" || _repObj.GetRoleId(uid) != "A") { if (_repObj.GetRoleId(uid) == "C") { return(RedirectToAction("CustomerHome", "User")); } if (_repObj.GetRoleId(uid) == "F") { return(RedirectToAction("FarmerHome", "User")); } } var query = _repObj.GetFeedback(); List <Models.FeedBack> l1 = new List <Models.FeedBack>(); foreach (var item in query) { l1.Add(_mapper.Map <Models.FeedBack>(item)); } return(View(l1)); } catch (Exception) { return(View("Error")); } }