public async Task <IActionResult> Create([Bind("Id,Nombre,Nacionalidad,AnyNacimiento")] Autor autor) { if (ModelState.IsValid) { _context.Add(autor); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(autor)); }
public async Task <IActionResult> Create([Bind("Id,Title,ReleaseDate,Genre,Price")] Categoria categoria) { if (ModelState.IsValid) { _context.Add(categoria); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(categoria)); }
public async Task <IActionResult> Create([Bind("Id,Titulo,Descripcion,Fecha,CategoriaId")] Comic comic) { if (ModelState.IsValid) { _context.Add(comic); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["CategoriaId"] = new SelectList(_context.Categoria, "Id", "Id", comic.CategoriaId); return(View(comic)); }