Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -10,11 +11,11 @@ namespace MyShop.WebUI.Controllers
{
public class ProductCategoryManagerController : Controller
{
InMemoryRepository<ProductCategory> context;
IRepository<ProductCategory> context;

public ProductCategoryManagerController()
public ProductCategoryManagerController(IRepository<ProductCategory> context)
{
context = new InMemoryRepository<ProductCategory>();
this.context = context;
}
// GET: ProductManager
public ActionResult Index()
Expand Down Expand Up @@ -110,6 +111,7 @@ public ActionResult ConfirmDelete(string Id)
else
{
context.Delete(Id);
context.Commit();
return RedirectToAction("Index");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ public ActionResult ConfirmDelete(string Id) {
else
{
context.Delete(Id);
context.Commit();
return RedirectToAction("Index");
}
}
Expand Down