Пример #1
0
        public async Task <IActionResult> Create([Bind("ID_rol,nombre_rol,descripcion")] rol rol)
        {
            if (ModelState.IsValid)
            {
                _context.Add(rol);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(rol));
        }
Пример #2
0
        public async Task <IActionResult> Create([Bind("ID_area,Nombre_area")] area area)
        {
            if (ModelState.IsValid)
            {
                _context.Add(area);
                await _context.SaveChangesAsync();

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