public async Task <IActionResult> UpdateSchedule([FromBody] Schedule schedule, [FromRoute] int id) { _DbContext.Attach(schedule); _DbContext.Schedules.Update(schedule); await _DbContext.SaveChangesAsync(); return(CreatedAtAction(nameof(GetByScheduleId), new { id = schedule.Id })); }