Beispiel #1
0
        public async Task <IActionResult> Register([Bind("ID,Username,Password")] User user)
        {
            if (ModelState.IsValid)
            {
                _context.Add(user);
                await _context.SaveChangesAsync();

                return(RedirectToAction("LoginUser", user));
            }
            return(View(user));
        }
Beispiel #2
0
        public async Task <IActionResult> Create([Bind("ID,Username,Password")] User user)
        {
            if (ModelState.IsValid)
            {
                _context.Add(user);
                await _context.SaveChangesAsync();

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