예제 #1
0
        public async Task <IActionResult> Create([Bind("Idcategoria,Nombre,Descripcion,Estado")] Categoria categoria)
        {
            if (ModelState.IsValid)
            {
                _context.Add(categoria);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(categoria));
        }
예제 #2
0
        public async Task <IActionResult> Create([Bind("Id,notasCromaticas,IsChecked")] NotasModel notasModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(notasModel);
                await _context.SaveChangesAsync();

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