public async Task <IActionResult> PutSpeaker(string id, Speaker speaker) { if (id != speaker.speakerId) { return(BadRequest()); } _context.Entry(speaker).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SpeakerExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task AddAsync(Speaker speaker) { await _speakers.AddAsync(speaker); await _context.SaveChangesAsync(); }