public bool RemoveData() { try { foreach (var e in ds.RoleClaims) { ds.Entry(e).State = System.Data.Entity.EntityState.Deleted; } ds.SaveChanges(); return true; } catch (Exception) { return false; } }
public ActionResult Remove() { if (m.RemoveData()) { return(Content("data has been removed")); } else { return(Content("could not remove data")); } }