public async Task <IActionResult> Detail(int id) { var userId = _userManager.GetUserId(User); ViewBag.userid = userId; var dashboard = await _dashboardManager.GetById(id); if (dashboard != null) { var result = _mapper.Map <DashboardDto, DashboardViewModel>(dashboard); return(View(result)); } return(NotFound("The dashboard is not found!")); }