public async Task <ActionResult> Edit(string id) { if (id == null) { return(RedirectToAction("Index", "Error")); } var model = await modelService.GetModelByIdAsync(id); if (model == null) { return(RedirectToAction("Index", "Error")); } return(View(model)); }