public async Task <IActionResult> List() { //SuccessMsg is used to hide or display the data saved alert notification. @ViewBag.SuccessMsg = "hidden"; if (RouteData.Values.ContainsKey("Id")) { string key; key = RouteData.Values["Id"].ToString(); if (key == "success") { @ViewBag.SuccessMsg = ""; } } var user = await GetCurrentUserAsync(); var siteId = user.SiteID; var data = _repository.GetAllAvailableStock(siteId); return(View(data)); }