Ejemplo n.º 1
0
        public async Task <IActionResult> Create([Bind("UserId,UserName,Password")] User user)
        {
            if (ModelState.IsValid)
            {
                _context.Add(user);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Login"));
            }
            return(View(user));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("LocationId,Name,Rating,Address,Description")] Location location)
        {
            if (ModelState.IsValid)
            {
                _context.Add(location);
                await _context.SaveChangesAsync();

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