示例#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));
        }
示例#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));
        }