protected override IController GetControllerInstance(RequestContext requestContext, Type controllerType)
        {
            IProductRepository productRepository = new ProductRepository();
            var productService = new ProductService(productRepository);

            if (controllerType == (typeof(HomeController)))
            {
                return new HomeController(productService);
            }

            if (controllerType == (typeof(ProductController)))
            {
                return new ProductController(productService);
            }
            return base.GetControllerInstance(requestContext, controllerType);
        }
        //
        // GET: /Default/
        public ActionResult Index()
        {
            var productRepository = new ProductRepository();
            var productService = new ProductService(productRepository);

            var products = productService.GetProductsOnSale();

            var vm = new HomePageViewModel();
            vm.Products = new List<ViewModelProduct>();

            foreach (var product in products)
            {
                vm.Products.Add(new ViewModelProduct(product.Id, product.Name));
            }
            return View(vm);
        }
 public AuditingProductRepository(ProductRepository repository, IAuditor auditor)
 {
     innerRepository = repository;
     this.auditor = auditor;
 }