public IActionResult CreateOverTime([FromBody] OverTime OverTimeToCreate) { if (OverTimeToCreate == null) { return(BadRequest(ModelState)); } if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (!_OverTimeRepository.CreateOverTime(OverTimeToCreate)) { return(StatusCode(500, ModelState)); } return(CreatedAtRoute("GetOverTime", new { OverTimeId = OverTimeToCreate.OverTimeId }, OverTimeToCreate)); }