Ejemplo n.º 1
0
        public async Task <IActionResult> Create(Product product)

        {
            if (ModelState.IsValid)
            {
                _context.Add(product);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ProductSellViewModel productSellViewModel = new ProductSellViewModel(_context);

            return(View(productSellViewModel));
        }
Ejemplo n.º 2
0
        // GET: Products/Create
        public IActionResult Create()
        {
            ProductSellViewModel productSellViewModel = new ProductSellViewModel(_context);

            return(View(productSellViewModel));
        }