コード例 #1
0
        public IActionResult UpdateOverTime(int OverTimeId, [FromBody] OverTime OverTimeToUpdate)
        {
            if (OverTimeToUpdate == null)
            {
                return(BadRequest(ModelState));
            }

            if (OverTimeId != OverTimeToUpdate.OverTimeId)
            {
                return(BadRequest(ModelState));
            }

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (!_OverTimeRepository.UpdateOverTime(OverTimeToUpdate))
            {
                return(StatusCode(500, ModelState));
            }
            return(NoContent());
        }