public async Task <IActionResult> PutPracticalExam(int id, [FromForm] PracticalExam practicalExam) { if (id != practicalExam.id) { return(BadRequest()); } practicalExam.updated_at = DateTime.Now; _context.Entry(practicalExam).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PracticalExamExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <PracticalExam> > PostPracticalExam([FromForm] PracticalExam practicalExam) { practicalExam.status = "PENDING"; _context.practicalExams.Add(practicalExam); await _context.SaveChangesAsync(); return(CreatedAtAction("GetPracticalExam", new { id = practicalExam.id }, practicalExam)); }