public async Task <IActionResult> PutTicketCorrespondenceModel(long id, TicketCorrespondenceModel ticketCorrespondenceModel) { if (id != ticketCorrespondenceModel.CorrispondenceId) { return(BadRequest()); } _context.Entry(ticketCorrespondenceModel).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TicketCorrespondenceModelExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <TicketCorrespondenceModel> > PostTicketCorrespondenceModel(TicketCorrespondenceModel ticketCorrespondenceModel) { _context.TicketCorrespondence.Add(ticketCorrespondenceModel); await _context.SaveChangesAsync(); return(CreatedAtAction("GetTicketCorrespondenceModel", new { id = ticketCorrespondenceModel.CorrispondenceId }, ticketCorrespondenceModel)); }