From 17cf2e94baf6f2fe9a298170fcdc3a889778c9ae Mon Sep 17 00:00:00 2001 From: Jason Zhu Date: Sat, 21 Aug 2021 16:07:45 +1000 Subject: [PATCH] 7.4.5 Creating the Product Repository; e.g. 7.14 Adding the Real Repository Binding --- .../Infrastructure/NinjectControllerFactory.cs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/SportsStore/SportsStore.WebUI/Infrastructure/NinjectControllerFactory.cs b/SportsStore/SportsStore.WebUI/Infrastructure/NinjectControllerFactory.cs index 00d1589..a537e7c 100644 --- a/SportsStore/SportsStore.WebUI/Infrastructure/NinjectControllerFactory.cs +++ b/SportsStore/SportsStore.WebUI/Infrastructure/NinjectControllerFactory.cs @@ -8,6 +8,7 @@ using System.Web.Mvc; using System.Web.Routing; using SportsStore.Domain.Abstract; using SportsStore.Domain.Entities; +using SportsStore.Domain.Concrete; namespace SportsStore.WebUI.Infrastructure { @@ -29,16 +30,7 @@ namespace SportsStore.WebUI.Infrastructure private void AddBindings() { - // Mock implementation of the IProductRepository Interface - Mock mock = new Mock(); - mock.Setup(m => m.Products).Returns(new List - { - new Product { Name = "Football", Price = 25 }, - new Product { Name = "Surf board", Price = 179 }, - new Product { Name = "Running shoes", Price = 95 } - }.AsQueryable()); - - ninjectKernel.Bind().ToConstant(mock.Object); + ninjectKernel.Bind().To(); } } } \ No newline at end of file