Skip to content

Instantly share code, notes, and snippets.

@johnmmoss
Last active August 29, 2015 14:19
Show Gist options
  • Save johnmmoss/8c487b79974ee3dfbd3e to your computer and use it in GitHub Desktop.
Save johnmmoss/8c487b79974ee3dfbd3e to your computer and use it in GitHub Desktop.
ASP.NET Standard Edit Controller
// GET: /Department/Edit/5
public ActionResult Edit(int? id)
{
if (id == null)
{
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
}
Department department = _context.Departments.Find(id);
if (department == null)
{
return HttpNotFound();
}
return View(department);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment