Esempio n. 1
0
        public async Task <IActionResult> Create([Bind("Id,Nome,Celular,Valor,Produto,Pagamento")] Buy buy)
        {
            if (ModelState.IsValid)
            {
                _context.Add(buy);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(buy));
        }
Esempio n. 2
0
        public async Task <IActionResult> Create([Bind("Id,Marca,Quantidade,Valor,Tamanho")] Clothes clothes)
        {
            if (ModelState.IsValid)
            {
                _context.Add(clothes);
                await _context.SaveChangesAsync();

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