Example #1
0
        public async Task <IActionResult> Create([Bind("Id,Login,Password")] Users users)
        {
            if (ModelState.IsValid)
            {
                _context.Add(users);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(users));
        }
Example #2
0
        public async Task <IActionResult> Create([Bind("Id,LastName,FirstName,Age")] Persons persons)
        {
            if (ModelState.IsValid)
            {
                _context.Add(persons);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(persons));
        }