Exemplo n.º 1
0
        public UnitOfWork(CoopEshopContext context)
        {
            ctx = context;

            Products        = new ProductRepository(ctx);
            InventoryItems  = new InventoryItemRepository(ctx);
            PriceComponents = new PriceComponentRepository(ctx);
        }
Exemplo n.º 2
0
        public IActionResult ProductsOffered()
        {
            AppUser seller = _userManager.Users.FirstOrDefault(x => x.UserName == User.Identity.Name);
            IInventoryItemRepository       inventoryItemRepository  = _unitOfWork.InventoryItems;
            IPriceComponentRepository      priceComponentRepository = _unitOfWork.PriceComponents;
            SellerProductsOfferedViewModel model = new SellerProductsOfferedViewModel
            {
                Seller                   = seller,
                SellerRepository         = inventoryItemRepository.GetSellerItems(seller),
                InventoryItemRepository  = inventoryItemRepository,
                PriceComponentRepository = priceComponentRepository
            };

            return(View(model));
        }