private TDay AddExercisesToTrainingDay <TDay>(TDay returnDto, TrainingDay sourceDto)
            where TDay : TrainingDay <Guid>
        {
            var mainLifts      = new List <ExerciseInTrainingDay>();
            var accessoryLifts = new List <ExerciseInTrainingDay>();

            if (sourceDto.ExercisesInTrainingDay != null)
            {
                foreach (var exercise in sourceDto.ExercisesInTrainingDay)
                {
                    switch (exercise.ExerciseType?.TypeCode)
                    {
                    case ExerciseTypeTypeCodes.MainLift:
                        {
                            var mappedExercise = BLLMapperContext.ExerciseInTrainingDayMapper.MapDALToBLL(exercise);
                            mainLifts.Add(mappedExercise);
                            break;
                        }

                    case ExerciseTypeTypeCodes.Accessory:
                    {
                        var mappedExercise = BLLMapperContext.ExerciseInTrainingDayMapper.MapDALToBLL(exercise);
                        accessoryLifts.Add(mappedExercise);
                        break;
                    }
                    }
                }
            }

            returnDto.MainLifts      = mainLifts;
            returnDto.AccessoryLifts = accessoryLifts;
            return(returnDto);
        }
        public UserTrainingDay MapDALToUserTrainingDay(TrainingDay dalEntity)
        {
            var userTrainingDay = new UserTrainingDay
            {
                Id              = dalEntity.Id,
                Date            = dalEntity.Date,
                TrainingWeekId  = dalEntity.TrainingWeekId,
                TrainingDayType = dalEntity.TrainingDayType == null
                    ? null
                    : BLLMapperContext.TrainingDayTypeMapper.MapDALToBLL(dalEntity.TrainingDayType),
                TrainingDayTypeId = dalEntity.TrainingDayTypeId
            };

            return(AddExercisesToTrainingDay(userTrainingDay, dalEntity));
        }
        public BaseTrainingDay MapDALToBLL(TrainingDay dalObject)
        {
            var trainingDay = new BaseTrainingDay
            {
                Id              = dalObject.Id,
                DayOfWeek       = dalObject.Date.DayOfWeek,
                TrainingWeekId  = dalObject.TrainingWeekId,
                TrainingDayType = dalObject.TrainingDayType == null
                    ? null
                    : BLLMapperContext.TrainingDayTypeMapper.MapDALToBLL(dalObject.TrainingDayType),
                TrainingDayTypeId = dalObject.TrainingDayTypeId
            };

            return(AddExercisesToTrainingDay(trainingDay, dalObject));
        }