예제 #1
0
        public async Task <IActionResult> Create([Bind("Id,Name")] Roles roles)
        {
            if (ModelState.IsValid)
            {
                _context.Add(roles);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(roles));
        }
예제 #2
0
        public async Task <IActionResult> Create([Bind("Id,FirstName,LastName,DateOfBirth,Login")] Users users)
        {
            if (ModelState.IsValid)
            {
                _context.Add(users);
                await _context.SaveChangesAsync();

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