Ejemplo n.º 1
0
        public async Task <IActionResult> Create([Bind("Product_TypeId,type")] Product_Type product_Type)
        {
            if (ModelState.IsValid)
            {
                _context.Add(product_Type);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(product_Type));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("itemId,Title,ReleaseDate,Genre,Price")] item item)
        {
            if (ModelState.IsValid)
            {
                _context.Add(item);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(item));
        }