public void Post([FromBody] ExerciseTipViewModel exerciseTip) { var exerciseTipEntity = new ExerciseTip { ExerciseId = exerciseTip.ExerciseId, Description = exerciseTip.Description }; _exerciseTipRepository.Create(exerciseTipEntity); }
public void Post([FromBody] ExerciseViewModel exercise) { var exerciseEntity = new Exercise { ExerciseCategoryId = exercise.ExerciseCategoryId, Description = exercise.Description, }; _exerciseRepository.Create(exerciseEntity); foreach (var exerciseTip in exercise.ExerciseTip) { var exerciseTipEntity = new ExerciseTip { ExerciseId = exerciseEntity.Id, Description = exerciseTip.Description }; _exerciseTipRepository.Create(exerciseTipEntity); } }