public Report Create(CategoryViewModel viewModel) { return new Report { Category = viewModel.Category }; }
public async Task<ActionResult> Index(CategoryViewModel viewModel) { if (!ModelState.IsValid) { return View(viewModel); } // TODO: replace AnonymousToken in Report model by a custom HTTP header var report = _modelFactory.Create(viewModel); report = await _reportProxy.PostAsync(report); await EnsureReportAccess(report); return RedirectToAction("Location"); }