public async Task PutLectureship(Guid id, Lectureship Lectureship) { if (id != Lectureship.Id) { return; } _context.Entry(Lectureship).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LectureshipExists(id)) { return; } else { throw; } } return; }
public async Task <ActionResult <Lectureship> > PostLectureship(Lectureship lectureship) { _context.Lectureship.Add(lectureship); await _context.SaveChangesAsync(); return(CreatedAtAction("GetLectureship", new { id = lectureship.Id }, lectureship)); }
public async Task <Lectureship> PostLectureship(Lectureship Lectureship) { _context.Lectureship.Add(Lectureship); await _context.SaveChangesAsync(); return(Lectureship); }
public async Task <IActionResult> PutLectureship(Guid id, Lectureship lectureship) { if (id != lectureship.Id) { return(BadRequest()); } _context.Entry(lectureship).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LectureshipExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }