Beispiel #1
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));
        }
Beispiel #2
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));
        }
 public void Insert(Funcionario obj)
 {
     _context.Add(obj);
     _context.SaveChanges();
 }