public async Task <IActionResult> EditReportElement(EditReportElementViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }
            ReportElementDto reportElement = _mapper.Map <EditReportElementViewModel, ReportElementDto>(model);
            await _reportElementManager.EditReportElement(reportElement);

            return(RedirectToAction("Detail", "Dashboard", new { id = model.DashboardId }));
        }
        public async Task <IActionResult> EditReportElement(int id)
        {
            ReportElement reportElement = await _reportElementManager.GetById(id);

            if (reportElement == null)
            {
                return(NotFound());
            }
            EditReportElementViewModel model = _mapper.Map <ReportElement, EditReportElementViewModel>(reportElement);

            return(View(model));
        }