Ejemplo n.º 1
0
        public async Task <IActionResult> Create([Bind("Id,Country,Recommendation")] LocationModel locationModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(locationModel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(locationModel));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("Id,FirstName,LastName,Username,Email,Password")] UserModel userModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(userModel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(userModel));
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> Signup(UserModel user)
        {
            if (ModelState.IsValid)
            {
                _context.Add(user);
                await _context.SaveChangesAsync();

                return(Redirect("Login"));
            }

            return(View(user));
        }