public async Task <IActionResult> Edit(int id, [Bind("ID,Monto,Dia,Mes,Anio,Categoria,Descripcion")] Gasto gasto) { if (id != gasto.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(gasto); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GastoExists(gasto.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(gasto)); }