public async Task <IActionResult> PutLine(int id, Line line) { if (id != line.LineId) { return(BadRequest()); } _context.Entry(line).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LineExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutTopic(int id, Topic topic) { if (id != topic.TopicId) { return(BadRequest()); } _context.Entry(topic).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TopicExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutSection(int id, Section section) { if (id != section.SectionId) { return(BadRequest()); } _context.Entry(section).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SectionExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }