private WeightTrainingDTO ConvertWeightTraining(WeightTraining training) { List <RoundDTO> roundDTOs = new List <RoundDTO>(); foreach (var round in training.GetRounds()) { roundDTOs.Add(ConvertRound(round)); } WeightTrainingDTO trainingDTO = new WeightTrainingDTO(roundDTOs, training.TrainingID, training.UserID, training.Date, (TrainingTypeDTO)training.TrainingType); return(trainingDTO); }
private WeightTraining ConvertWeightTrainingDTO(WeightTrainingDTO trainingDTO) { List <Round> rounds = new List <Round>(); foreach (var roundDTO in trainingDTO.GetRounds()) { rounds.Add(ConvertRoundDTO(roundDTO)); } WeightTraining training = new WeightTraining(rounds, trainingDTO.TrainingID, trainingDTO.UserID, trainingDTO.Date, (TrainingType)trainingDTO.TrainingType); return(training); }