public void DeactivateEmployment(Employment employment) { _employmentService.GetAllEmploymentsByEmployeeId(employment.EmployeeId).ForEach(e => { if (e.Id.Equals(employment.Id)) { e.IsActive = false; _employmentService.UpdateEmployment(e); } }); }
public async Task <ActionResult <EmploymentConfirmation> > PutEmployment(Guid carStationId, Guid employeeId, [FromBody] EmploymentPutBody employmentPutBody) { var updatedEmploymentConfirmation = await _service.UpdateEmployment(employeeId, carStationId, employmentPutBody); if (updatedEmploymentConfirmation == null) { return(BadRequest()); } return(Ok(updatedEmploymentConfirmation)); }