public async Task <IActionResult> Edit(int id, [Bind("CholesterolRiskId,DateCholTaken,TotalCholesterol,LdlCholesterol,HdlCholesterol,Triglycerides,TakenAfterFasting,TotalCholGoal,LdlCholGoal,HdlCholGoal,TriglycerideGoal,Comments")] CholesterolRisk cholesterolRisk) { if (id != cholesterolRisk.CholesterolRiskId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(cholesterolRisk); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CholesterolRiskExists(cholesterolRisk.CholesterolRiskId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(cholesterolRisk)); }
public async Task <IActionResult> Create([Bind("CholesterolRiskId,DateCholTaken,TotalCholesterol,LdlCholesterol,HdlCholesterol,Triglycerides,TakenAfterFasting,TotalCholGoal,LdlCholGoal,HdlCholGoal,TriglycerideGoal,Comments")] CholesterolRisk cholesterolRisk) { if (ModelState.IsValid) { _context.Add(cholesterolRisk); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(cholesterolRisk)); }