From af72b18ba097310f55152ee0f1654fe4df6dea89 Mon Sep 17 00:00:00 2001 From: Sergey Chebotar Date: Thu, 16 Feb 2023 07:23:48 +0300 Subject: MyDarlingRepository DI --- Controllers/HomeController.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Controllers/HomeController.cs') diff --git a/Controllers/HomeController.cs b/Controllers/HomeController.cs index 255af9f..228a9c3 100644 --- a/Controllers/HomeController.cs +++ b/Controllers/HomeController.cs @@ -6,14 +6,14 @@ namespace MyDarling.Controllers { public class HomeController : Controller { - private DataContext context; - public HomeController(DataContext context) + private IRepository repository; + public HomeController(IRepository repository) { - this.context = context; + this.repository = repository; } public IActionResult Index() { - return View(context.UnderwearBundles.Include(bundle => bundle.Figures).Where(x => x.Price != 0)); + return View(repository); } } } \ No newline at end of file -- cgit v1.2.3