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