public async Task <IActionResult> PostHealthAndBeautySerAtTour([FromBody] HealthAndBeautySerAtTour healthAndBeautySerAtTour) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.HealthAndBeautySerAtTour.Add(healthAndBeautySerAtTour); await _context.SaveChangesAsync(); return(CreatedAtAction("GetHealthAndBeautySerAtTour", new { id = healthAndBeautySerAtTour.HealthAndBeautySerAtTourId }, healthAndBeautySerAtTour)); }
public async Task <IActionResult> PutHealthAndBeautySerAtTour([FromRoute] int id, [FromBody] HealthAndBeautySerAtTour healthAndBeautySerAtTour) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != healthAndBeautySerAtTour.HealthAndBeautySerAtTourId) { return(BadRequest()); } _context.Entry(healthAndBeautySerAtTour).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!HealthAndBeautySerAtTourExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }