public IActionResult CreateSchedule([FromBody] ScheduleForCreationDto schedule) { try { if (schedule == null) { _logger.LogError("Schedule object sent from client is null."); return(BadRequest("Schedule object is null")); } if (!ModelState.IsValid) { _logger.LogError("Invalid Schedule object sent from client."); return(BadRequest("Invalid model object")); } bool succes = _scheduleLogic.Create(schedule); return(Ok("Schedule is created")); } catch (Exception ex) { return(StatusCode(500, "Internal server error")); } }