summaryrefslogtreecommitdiff
path: root/Controllers/BundlesController.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Controllers/BundlesController.cs')
-rw-r--r--Controllers/BundlesController.cs47
1 files changed, 0 insertions, 47 deletions
diff --git a/Controllers/BundlesController.cs b/Controllers/BundlesController.cs
deleted file mode 100644
index aeefebb..0000000
--- a/Controllers/BundlesController.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-using Microsoft.AspNetCore.Mvc;
-using Microsoft.EntityFrameworkCore;
-using MyDarling.Models;
-
-namespace MyDarling.Controllers
-{
- public class BundlesController : Controller
- {
- private IRepository repository;
-
- public BundlesController(IRepository repository)
- {
- this.repository = repository;
- }
-
- public ActionResult Index()
- {
- return View(repository);
- }
-
- public ActionResult Edit(int id)
- {
- 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");
- }
-
- public ActionResult Add()
- {
- return View();
- }
- [HttpPost]
- public ActionResult Add(UnderwearBundle b)
- {
- repository.Add(b);
- return RedirectToAction("Index");
- }
- }
-} \ No newline at end of file