public IActionResult Edit(int id) { var reportMetaData = Rdb.ReportMetaData.FirstOrDefault(x => x.ReportMetaDataId == id); var reportMetaDataViewModel = new ReportMetadataViewModel(reportMetaData); return(View(reportMetaDataViewModel)); }
public async Task <IActionResult> Edit(ReportMetadataViewModel reportMetaDataViewModel) { var newTitle = reportMetaDataViewModel.Title; var actualReportMetadata = Rdb.ReportMetaData.First(x => x.ReportMetaDataId == reportMetaDataViewModel.ReportMetadataId); actualReportMetadata.ReportDetails.Title = newTitle; Rdb.Update(actualReportMetadata); await Rdb.SaveChangesAsync(); return(RedirectToAction(ActionNames.Index)); }