public async Task <IActionResult> PutTraningInformation(int id, TraningInformation traningInformation) { if (id != traningInformation.ID) { return(BadRequest()); } _context.Entry(traningInformation).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TraningInformationExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <TraningInformation> > PostTraningInformation(TraningInformation traningInformation) { _context.TraningInformation.Add(traningInformation); await _context.SaveChangesAsync(); return(CreatedAtAction("GetTraningInformation", new { id = traningInformation.ID }, traningInformation)); }