public async Task <IActionResult> PutEmployeeClub([FromRoute] int id, [FromBody] EmployeeClub employeeClub) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != employeeClub.Employee_Club_Id) { return(BadRequest()); } _context.Entry(employeeClub).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EmployeeClubExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostEmployeeClub([FromBody] EmployeeClub employeeClub) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.Employee_club.Add(employeeClub); await _context.SaveChangesAsync(); return(CreatedAtAction("GetEmployeeClub", new { id = employeeClub.Employee_Club_Id }, employeeClub)); }