public async Task <IActionResult> Create([Bind("Id,Name,Details")] Accion accion) { if (ModelState.IsValid) { _context.Add(accion); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(accion)); }
public async Task <IActionResult> Create([Bind("Nombre")] Persona persona) { if (ModelState.IsValid) { _context.Add(persona); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(persona)); }
public async Task <IActionResult> Create([Bind("Id,Matricula")] Medico medico) { if (ModelState.IsValid) { _context.Add(medico); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["Id"] = new SelectList(_context.Personas, "Id", "Id", medico.Id); return(View(medico)); }