public async Task <ActionResult> SaveParsedMaterial() { object material; if (!TempData.TryGetValue("MaterialModel", out material)) { return(RedirectToAction("ParseMaterial")); } var saveMaterial = material as Material; if (saveMaterial == null) { return(RedirectToAction("ParseMaterial")); } await _materialService.SaveMaterial((Material)material); return(RedirectToAction("DisplayAll")); // TODO: redirect to material page. }