public void Modify(Report report, LocationViewModel viewModel) { if (report.Location == null) { report.Location = new Location(); } report.Location.Building = viewModel.Building; }
public async Task<ActionResult> Location(LocationViewModel viewModel) { if (!ModelState.IsValid) { return View(viewModel); } var reportId = GetCurrentReportId(); var report = new Report(); _modelFactory.Modify(report, viewModel); var responseReport = await _reportProxy.PatchAsync(reportId, report); return RedirectToAction("AdditionalLocation"); }