public async Task <IActionResult> Edit(int id, [Bind("Id,Plaque")] gastoEntity gastoEntity) { if (id != gastoEntity.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(gastoEntity); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!gastoEntityExists(gastoEntity.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(gastoEntity)); }
public async Task <IActionResult> Create(gastoEntity gastoEntity) { if (ModelState.IsValid) { gastoEntity.Plaque = gastoEntity.Plaque.ToUpper(); _context.Add(gastoEntity); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(gastoEntity)); }