Exemple #1
0
        public async Task <IActionResult> Create([Bind("Id,Grad")] Graduacao graduacao)
        {
            if (ModelState.IsValid)
            {
                _context.Add(graduacao);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(graduacao));
        }
Exemple #2
0
        public async Task <IActionResult> Create([Bind("Id,Name")] Unidade unidade)
        {
            if (ModelState.IsValid)
            {
                _context.Add(unidade);
                await _context.SaveChangesAsync();

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