public async Task <IActionResult> PutBusinessSerAtTour([FromRoute] int id, [FromBody] BusinessSerAtTour businessSerAtTour) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != businessSerAtTour.BusinessSerArTourId) { return(BadRequest()); } _context.Entry(businessSerAtTour).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BusinessSerAtTourExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostBusinessSerAtTour([FromBody] BusinessSerAtTour businessSerAtTour) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.BusinessSerAtTour.Add(businessSerAtTour); await _context.SaveChangesAsync(); return(CreatedAtAction("GetBusinessSerAtTour", new { id = businessSerAtTour.BusinessSerArTourId }, businessSerAtTour)); }