public async Task <IActionResult> Edit(long id, [Bind("Id,Date,Value")] RateTableModel rate) { if (id != rate.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(rate); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RateExists(rate.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(rate)); }
public async Task <IActionResult> Create([Bind("Id,Date,Value")] RateTableModel rate) { if (ModelState.IsValid) { _context.Add(rate); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(rate)); }