public async Task <ActionResult> DeleteConfirmed(int id) { AdvocateGroup advocateGroup = await db.AdvocateGroups.FindAsync(id); db.AdvocateGroups.Remove(advocateGroup); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "Id,GroupName,Description,CreatedBy,CreatedOn,ModifiedBy,ModifiedOn")] AdvocateGroup advocateGroup) { if (ModelState.IsValid) { db.Entry(advocateGroup).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(advocateGroup)); }
// GET: AdvocateGroups/Delete/5 public async Task <ActionResult> Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } AdvocateGroup advocateGroup = await db.AdvocateGroups.FindAsync(id); if (advocateGroup == null) { return(HttpNotFound()); } return(View(advocateGroup)); }