예제 #1
0
        public async Task <IActionResult> Create([Bind("idDpto,dsDpto")] Departamento departamento)
        {
            if (ModelState.IsValid)
            {
                _context.Add(departamento);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(departamento));
        }
예제 #2
0
        public async Task <IActionResult> Create([Bind("idServico,dsServico")] Servico servico)
        {
            if (ModelState.IsValid)
            {
                _context.Add(servico);
                await _context.SaveChangesAsync();

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