Exemple #1
0
        public async Task <IActionResult> Create([Bind("Id,Nome,Email,Senha,Cpf,Celular,Sexo,DataNascimento,Cep,Endereco,Cidade,Estado")] Usuario usuario)
        {
            if (ModelState.IsValid)
            {
                _context.Add(usuario);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(usuario));
        }
Exemple #2
0
        public async Task <IActionResult> Create([Bind("Id,Titulo,Preco,Plataforma,TipoNegocio,Descricao,Img")] Game game)
        {
            if (ModelState.IsValid)
            {
                _context.Add(game);
                await _context.SaveChangesAsync();

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