public async Task<ActionResult<CodeCard>> PostCodeCard(CodeCard codeCard) { _context.Code_Card.Add(codeCard); await _context.SaveChangesAsync(); return CreatedAtAction("GetCodeCard", new { id = codeCard.Id }, codeCard); }
public async Task<IActionResult> PutCodeCard(int id, CodeCard codeCard) { if (id != codeCard.Id) { return BadRequest(); } _context.Entry(codeCard).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CodeCardExists(id)) { return NotFound(); } else { throw; } } return NoContent(); }
public void CreateCodeCard(CodeCard cc) { if (cc == null) { throw new ArgumentNullException(nameof(cc)); } _context.CodeCards.Add(cc); }
public CodeDeckTests() { testCodeCard = new CodeCard { Challenge = "Challenging", JavaAnswer = "Answer", JavaScriptAnswer = "Answer", PythonAnswer = "Answer", CAnswers = "Answer" }; }
public void Dispose() { testCodeCard = null; }
public void UpdateCodeCard(CodeCard cc) { // Nothing }