public async Task <IActionResult> Edit(int id, [Bind("Id_votacion,Id_restaurante,Id_dato,Votacion")] tbl_Votaciones tbl_Votaciones) { if (id != tbl_Votaciones.Id_votacion) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(tbl_Votaciones); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!tbl_VotacionesExists(tbl_Votaciones.Id_votacion)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(tbl_Votaciones)); }
public async Task <IActionResult> Create([Bind("Id_votacion,Id_restaurante,Id_dato,Votacion")] tbl_Votaciones tbl_Votaciones) { if (ModelState.IsValid) { _context.Add(tbl_Votaciones); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(tbl_Votaciones)); }