public productsController(IProductRepo productRepo, IReviewRepo reviewRepo, IMapper mapper, IClientService clientService) { _ProductRepo = productRepo; _ReviewRepo = reviewRepo; _mapper = mapper; _clientService = clientService; }
public ProductController(IGenericsRepo <ProductType> productTypes, IGenericsRepo <ProductBrand> productBrand, IProductRepo productRepo, IMapper mapper) { _mapper = mapper; _productBrand = productBrand; _productRepo = productRepo; _productTypes = productTypes; }
public ShoppingCartRepo(StoreContext context, IProductRepo productRepo, ICustomerRepo customerRepo) : base(context) { _productRepo = productRepo; _customerRepo = customerRepo; }
public ProductsController(IProductRepo productRepo, ICategoryRepo categoryRepo, IOptionsSnapshot <CustomSettings> settings, ILogger <ProductsController> logger) { _productRepo = productRepo; _categoryRepo = categoryRepo; Logger = logger; }
public ActionResult Detail(int id) { IProductRepo repo = UnitOfWork.ProductRepo; Product product = repo.FindById(id); return(View(product)); }
public OrderBLL(IOrderRepo stub) { _repo = stub; _productrepo = new ProductRepoStub(); _customerrepo = new CustomerRepoStub(); _accountrepo = new AccountRepoStub(); }
public GetProductsAndFiltr( IProductRepo productRepo, List <IFilter <Product> > filters) { _productRepo = productRepo; _filters = filters; }
public ActionResult List(int id = 1, string product = null, int?category = null) { IProductRepo repo = UnitOfWork.ProductRepo; List <Product> products = null; if (product != null && category != null) { products = repo.Get(p => p.CategoryId == category.Value && p.Name.Contains(product)).ToList(); } else if (product != null) { products = repo.Get(p => p.Name.Contains(product)).ToList(); } else if (category != null) { products = repo.Get(p => p.CategoryId == category.Value).ToList(); } else { products = repo.Get().ToList(); } IEnumerable <GetProductListViewModel> result = products.Select(p => new GetProductListViewModel { Id = p.Id, Name = p.Name, Category = p.Category.Name, Price = p.Price, }); ViewData["categories"] = UnitOfWork.CategoryRepo.Get().ToList(); return(View(result.ToPagedList(id, 10))); }
public OrderController(ILoginRepo loginRepo, IOrderRepo orderRepo, ICartRepo cartRepo, IProductRepo productRepo) { _orderRepo = orderRepo; _loginRepo = loginRepo; _cartRepo = cartRepo; _productRepo = productRepo; }
public IHttpActionResult AddProductToBasket([FromBody] AddProductToBasketRequest request) { User user = GetCurrentUser(); if (user == null) { return(Unauthorized()); } IProductRepo repo = UnitOfWork.ProductRepo; Product product = repo.FindById(request.Id); try { UnitOfWork.Context.Database.ExecuteSqlCommand($"do $$ begin perform \"dbo\".add_product_to_basket({user.Id}, {product.Id}); end $$"); return(Ok( UnitOfWork .Context.Database .SqlQuery <int>($"select \"dbo\".get_product_count_from_basket({user.Id}, {product.Id});") .FirstOrDefault())); } catch { return(BadRequest()); } }
public OrderManager(IRepo repo, ITaxRepo taxRepo, IProductRepo prodRepo) { _orderRepo = repo; taxes = taxRepo.Load(); products = prodRepo.Load(); }
public ProductController(IUserRepo _iUserRepo, IAddressRepo _iAddressRepo, IProductRepo _iProductRepo, IProductOfferRepo _iProductOfferRepo) { iUserRepo = _iUserRepo; iAddressRepo = _iAddressRepo; iProductRepo = _iProductRepo; iProductOfferRepo = _iProductOfferRepo; }
public OrderBLL() { _repo = new OrderRepo(); _productrepo = new ProductRepo(); _customerrepo = new CustomerRepo(); _accountrepo = new AccountRepo(); }
public ProductOfUserController(IProductOfUserRepo repository, IMapper mapper, IUserRepo userRepo, IProductRepo productRepo) { _productRepo = productRepo; _userRepo = userRepo; _repository = repository; _mapper = mapper; }
internal ShoppingCartRepo(DbContextOptions <StoreContext> options) : base(options) { _productRepo = new ProductRepo(Context); _customerRepo = new CustomerRepo(Context); base.Dispose(); }
public ProductsController( IProductRepo productRepo, IOptionsSnapshot <CustomSettings> settings) { _settings = settings.Value; _productRepo = productRepo; }
public SavedItemsController(IClientService ClientService, IMapper mapper, UserManager <CustomIdentityUser> userManager, IProductRepo productRepo) { _ClientService = ClientService; _mapper = mapper; _UserManager = userManager; _productRepo = productRepo; }
public HistoryController(UserManager <CustomIdentityUser> userManager, IProductRepo productRepo, IMapper mapper, IClientService clientService) { _UserManager = userManager; _productRepo = productRepo; _mapper = mapper; _clientService = clientService; }
public UnitOfWork(DbContext context) { this.Context = context; consumer = new ConsumerRepo(context); product = new ProductRepo(context); //add attrs }
public ProductsController(IWebHostEnvironment webHost, IMapper mapper, IProductRepo productRepo, ICategoryRepo categoryRepo) { this.webHost = webHost; this.mapper = mapper; this.productRepo = productRepo; this.categoryRepo = categoryRepo; }
public ProductController(IProductRepo repo, AppDBContext db, IHostingEnvironment hostingEnvironment, ILogger <ProductController> logger) { this.repo = repo; this.db = db; this.hostingEnvironment = hostingEnvironment; _logger = logger; }
public FactorsController(IFactorRepo repository, IProductRepo productRepo, ICustomerRepo customerRepo, IOrderItemRepo orderItemRepo, IMapper mapper) { _repository = repository; _productRepo = productRepo; _customerRepo = customerRepo; _orderItemRepo = orderItemRepo; _mapper = mapper; }
public OrderService(IOrderRepo orderRepo, IProductRepo productRepo, ICustomerRepo customerRepo, IPaymentService paymentService, IShipStuff shippingService) { _orderRepo = orderRepo; _productRepo = productRepo; _customerRepo = customerRepo; _paymentService = paymentService; _shippingService = shippingService; }
public AnalyticsViewModel(IProductRepo productRepo, IOccupanciesRepo occupancieRepo) { _productRepo = productRepo; _occupancieRepo = occupancieRepo; ToProductAddViewCommand = new RelayCommand(ToReservationAddView); UpdateDataCommand = new RelayCommand(UpdateData); }
public BasketController(UserManager <User> userManager, IMapper mapper, IGenericsRepo <BasketItem> basketGenericRepo, IBasketRepo basketRepo, IProductRepo productRepo) { _mapper = mapper; _userManager = userManager; _basketRepo = basketRepo; _productRepo = productRepo; _basketGenericRepo = basketGenericRepo; }
public OrderService(IOrderRepo orderRepo, IProductRepo productRepo, ICustomerRepo customerRepo, IPaymentService paymentService, IBuildShips shipBuilder) { _orderRepo = orderRepo; _productRepo = productRepo; _customerRepo = customerRepo; _paymentService = paymentService; _shipBuilder = shipBuilder; }
public HomeController(ILogger <HomeController> logger, IStoreRepo StoreRepo, ICustomerRepo CustomerRepo, IOrderRepo OrderRepo, IProductRepo ProductRepo) { _logger = logger; _storeRepo = StoreRepo; _customerRepo = CustomerRepo; _orderRepo = OrderRepo; _productRepo = ProductRepo; }
public ProductService( ILoggerAdapter <ProductService> logger, IMetricService metrics, IProductRepo productRepo) { _productRepo = productRepo; _logger = logger; _metrics = metrics; }
public ProductsController( IProductRepo productRepo, IOptionsSnapshot <CustomSettings> settings, ILogger <ProductsController> logger) { _settings = settings.Value; _productRepo = productRepo; Logger = logger; }
public ShoppingCartController(ILogger <ShoppingCartController> logger, IStoreRepo StoreRepo, ICustomerRepo CustomerRepo, IOrderRepo OrderRepo, IProductRepo ProductRepo, IShoppingCart ShoppingCart) { _logger = logger; _storeRepo = StoreRepo; _customerRepo = CustomerRepo; _orderRepo = OrderRepo; _productRepo = ProductRepo; _shoppingCart = ShoppingCart; }
public ProductsController(IProductRepo productRepo) { _productRepo = productRepo; _config = new MapperConfiguration( cfg => { cfg.CreateMap <ProductAndCategoryBase, AddToCartViewModel>(); }); }
public ProductsController( ILogger <ProductsController> logger, IProductRepo productRepo, IOptionsMonitor <CustomSettings> settings) { _settings = settings.CurrentValue; _logger = logger; _productRepo = productRepo; }
public ProductUnitTest() { var factoryMock = new Mock<IDBContextFactory>(); fakeProductDbContext = new FakeProductDbContext(); productRepo = new ProductRepo(factoryMock.Object); factoryMock.Setup(o => o.createDbContext<IProductDbContext>(It.IsAny<String>())) .Returns(fakeProductDbContext); initData(); }
public ProductUnitTestDb() { scope = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions { IsolationLevel = IsolationLevel.ReadCommitted }, TransactionScopeAsyncFlowOption.Enabled); productDbContext = new ProductDbContext(ConnectionString); factoryMock = new Mock<IDBContextFactory>(); productRepo = new ProductRepo(factoryMock.Object); factoryMock.Setup(o => o.createDbContext<IProductDbContext>(It.IsAny<String>())) .Returns(productDbContext); }
public OrderManager() { string mode = ConfigurationManager.AppSettings["appName"]; if (mode == "Test") { var repo = new TestOrderRepo(); _repo = repo; } else { var repo = new ProdOrderRepo(); _repo = repo; _taxrepo = new TaxRepo(); _productrepo = new ProductRepo(); } }
public ProductController(IProductRepo repo) { _repository = repo; }
public ProductBLL() { _repo = new ProductRepo(); }
public CartRepo(IProductRepo productRepo, IDBContextFactory factory) { this.productRepo = productRepo; this.factory = factory; }
public ProductBLL(IProductRepo stub) { _repo = stub; }
public ProductBLL() { _productRepo = new ProductRepo(); _categoryRepo = new CategoryRepo(); }
public ProductBLL(IProductRepo stub) { _productRepo = stub; _categoryRepo = new CategoryRepoStub(); }