public async Task <IActionResult> Edit(int id, [Bind("ClientId,WeightInPounds,DateOfMessurment")] ClientWeight clientWeight) { if (id != clientWeight.ClientId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(clientWeight); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ClientWeightExists(clientWeight.ClientId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(clientWeight)); }
public async Task <IActionResult> Create([Bind("ClientId,WeightInPounds,DateOfMessurment")] ClientWeight clientWeight) { if (ModelState.IsValid) { _context.Add(clientWeight); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(clientWeight)); }