public async Task <ActionResult <JobHistory> > CreateJobHistory([FromBody] JobHistory jobHistory) { _log.LogDebug($"REST request to save JobHistory : {jobHistory}"); if (jobHistory.Id != 0) { throw new BadRequestAlertException("A new jobHistory cannot already have an ID", EntityName, "idexists"); } await _jobHistoryService.Save(jobHistory); return(CreatedAtAction(nameof(GetJobHistory), new { id = jobHistory.Id }, jobHistory) .WithHeaders(HeaderUtil.CreateEntityCreationAlert(EntityName, jobHistory.Id.ToString()))); }