public async Task <ActionResult <CampCreateModel> > PostCampCreateModel(CampCreateModel campCreateModel) { _context.CampCreateModel.Add(campCreateModel); await _context.SaveChangesAsync(); return(CreatedAtAction("GetCampCreateModel", new { id = campCreateModel.CampId }, campCreateModel)); }
public async Task <IActionResult> PutCampCreateModel(int id, CampCreateModel campCreateModel) { if (id != campCreateModel.CampId) { return(BadRequest()); } _context.Entry(campCreateModel).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CampCreateModelExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }