public async Task <IActionResult> PutMeetingLabel([FromRoute] int id, [FromBody] MeetingLabel meetingLabel) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != meetingLabel.Id) { return(BadRequest()); } _context.Entry(meetingLabel).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MeetingLabelExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostMeetingLabel([FromBody] MeetingLabel meetingLabel) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.MeetingLabel.Add(meetingLabel); await _context.SaveChangesAsync(); return(CreatedAtAction("GetMeetingLabel", new { id = meetingLabel.Id }, meetingLabel)); }