public async Task <IActionResult> PutIsRented(int id, bool rented, Rented rent) { if (id != rent.Id) { return(BadRequest()); } _context.Entry(rent).State = EntityState.Modified; _context.Entry(rented).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RentedExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutStudio(int id, Studio studio) { if (id != studio.Id) { return(BadRequest()); } _context.Entry(studio).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!StudioExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutTrivias(int id, Trivias trivias) { if (id != trivias.Id) { return(BadRequest()); } _context.Entry(trivias).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TriviasExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }