Beispiel #1
0
        public async Task <IActionResult> Create([Bind("ID,UserName,Nome,Senha,CPF,Aniversario")] UsuarioModel usuarioModel)
        {
            if (ModelState.IsValid)
            {
                usuarioModel.HashPassword(); //CRIPTOGRAFA SENHA
                _context.Add(usuarioModel);
                await _context.SaveChangesAsync();

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