From 91a76fb105b787aae20ca15cae71b1e0af8f837e Mon Sep 17 00:00:00 2001 From: Brett Hargreaves Date: Tue, 7 Nov 2017 14:18:24 +0000 Subject: [PATCH] added missing Commit --- .../Controllers/ProductCategoryManagerController.cs | 10 ++++++---- .../Controllers/ProductManagerController.cs | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/MyShop/MyShop.WebUI/Controllers/ProductCategoryManagerController.cs b/MyShop/MyShop.WebUI/Controllers/ProductCategoryManagerController.cs index dc2e38a..bec7555 100644 --- a/MyShop/MyShop.WebUI/Controllers/ProductCategoryManagerController.cs +++ b/MyShop/MyShop.WebUI/Controllers/ProductCategoryManagerController.cs @@ -1,4 +1,5 @@ -using MyShop.Core.Models; +using MyShop.Core.Contracts; +using MyShop.Core.Models; using MyShop.DataAccess.InMemory; using System; using System.Collections.Generic; @@ -10,11 +11,11 @@ namespace MyShop.WebUI.Controllers { public class ProductCategoryManagerController : Controller { - InMemoryRepository context; + IRepository context; - public ProductCategoryManagerController() + public ProductCategoryManagerController(IRepository context) { - context = new InMemoryRepository(); + this.context = context; } // GET: ProductManager public ActionResult Index() @@ -110,6 +111,7 @@ public ActionResult ConfirmDelete(string Id) else { context.Delete(Id); + context.Commit(); return RedirectToAction("Index"); } } diff --git a/MyShop/MyShop.WebUI/Controllers/ProductManagerController.cs b/MyShop/MyShop.WebUI/Controllers/ProductManagerController.cs index e791ff8..e2fc8a6 100644 --- a/MyShop/MyShop.WebUI/Controllers/ProductManagerController.cs +++ b/MyShop/MyShop.WebUI/Controllers/ProductManagerController.cs @@ -116,6 +116,7 @@ public ActionResult ConfirmDelete(string Id) { else { context.Delete(Id); + context.Commit(); return RedirectToAction("Index"); } }