public async Task <IActionResult> PutExerciseMuscle([FromRoute] int id, [FromBody] ExerciseMuscle exerciseMuscle) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != exerciseMuscle.ExerciseMuscleID) { return(BadRequest()); } _context.Entry(exerciseMuscle).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ExerciseMuscleExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutSplitDay([FromRoute] int id, [FromBody] SplitDay splitDay) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != splitDay.ID) { return(BadRequest()); } _context.Entry(splitDay).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SplitDayExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }