public async Task <IActionResult> PutTestQuestionMapping(int id, TestQuestionMapping testQuestionMapping) { if (id != testQuestionMapping.Id) { return(BadRequest()); } _context.Entry(testQuestionMapping).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TestQuestionMappingExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <TestQuestionMapping> > PostTestQuestionMapping(TestQuestionMapping testQuestionMapping) { _context.TestQuestionMapping.Add(testQuestionMapping); await _context.SaveChangesAsync(); return(CreatedAtAction("GetTestQuestionMapping", new { id = testQuestionMapping.Id }, testQuestionMapping)); }