public async Task <IActionResult> PutTeammateAntipreference(int id, TeammateAntipreference teammateAntipreference) { if (id != teammateAntipreference.Id) { return(BadRequest()); } _context.Entry(teammateAntipreference).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TeammateAntipreferenceExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <TeammateAntipreference> > PostTeammateAntipreference(TeammateAntipreference teammateAntipreference) { _context.TeammateAntipreferences.Add(teammateAntipreference); await _context.SaveChangesAsync(); return(CreatedAtAction("GetTeammateAntipreference", new { id = teammateAntipreference.Id }, teammateAntipreference)); }