public async Task <IActionResult> Edit(Guid id, [Bind("Id,Description,timeStamp")] DoctorsLog doctorsLog) { if (id != doctorsLog.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(doctorsLog); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DoctorsLogExists(doctorsLog.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(doctorsLog)); }
public async Task <IActionResult> Create([Bind("Id,Description,timeStamp")] DoctorsLog doctorsLog) { if (ModelState.IsValid) { doctorsLog.Id = Guid.NewGuid(); _context.Add(doctorsLog); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(doctorsLog)); }