public async Task <ActionResult> DeleteConfirmed(int id) { Models.PowerShell powerShell = await db.PowerShell.FindAsync(id); db.PowerShell.Remove(powerShell); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "ID,ScriptName,ScriptContent,CreatedDate,LastRunDate")] Models.PowerShell powerShell) { if (ModelState.IsValid) { db.Entry(powerShell).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(powerShell)); }
// GET: PowerShell/Details/5 public async Task <ActionResult> Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Models.PowerShell powerShell = await db.PowerShell.FindAsync(id); if (powerShell == null) { return(HttpNotFound()); } return(View(powerShell)); }