summaryrefslogtreecommitdiff
path: root/Controllers/BundlesController.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Controllers/BundlesController.cs')
-rw-r--r--Controllers/BundlesController.cs10
1 files changed, 10 insertions, 0 deletions
diff --git a/Controllers/BundlesController.cs b/Controllers/BundlesController.cs
index 8b66139..1f5c212 100644
--- a/Controllers/BundlesController.cs
+++ b/Controllers/BundlesController.cs
@@ -22,5 +22,15 @@ namespace MyDarling.Controllers
{
return View(repository.Bundles.Where(b => b.Id == id).FirstOrDefault());
}
+
+ public ActionResult Delete(int id)
+ {
+ var bundle = repository.Bundles.Where(b => b.Id == id).FirstOrDefault();
+ if (bundle != null)
+ {
+ repository.Remove(bundle);
+ }
+ return RedirectToAction("Index");
+ }
}
} \ No newline at end of file