public async Task <IActionResult> PutLaunchevent(int id, Launchevent launchevent) { if (id != launchevent.Id) { return(BadRequest()); } _context.Entry(launchevent).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LauncheventExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <Launchevent> > PostLaunchevent(Launchevent launchevent) { _context.Launchevent.Add(launchevent); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (LauncheventExists(launchevent.Id)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetLaunchevent", new { id = launchevent.Id }, launchevent)); }