public async Task AddNewTraining(NewTrainingDTO newTrainingDto)
        {
            var training = new DAL.App.DTO.Training()
            {
                Description     = newTrainingDto.Description,
                Duration        = newTrainingDto.Duration,
                TrainingPlaceId = newTrainingDto.TrainingPlaceId,
                Start           = DateTime.Parse(newTrainingDto.Start),
                StartTime       = TimeSpan.Parse(newTrainingDto.StartTime),
                TrainingStatus  = CreatedTrainingStatus,
                CreatorId       = newTrainingDto.CreatedBy.Id
            };

            var trainingwithId = ServiceRepository.AddNew(training);
            await ServiceUnitOfWork.SaveChangesAsync();

            var users = newTrainingDto.PeopleInvited;

            foreach (var user in users)
            {
                var usrInTraining = new DAL.App.DTO.UserInTraining()
                {
                    AppUserId         = user.Id,
                    TrainingId        = trainingwithId.Id,
                    AttendingTraining = false
                };
                ServiceUnitOfWork.UsersInTrainingRepository.AddNewUserInTraining(usrInTraining);
            }
            await ServiceUnitOfWork.SaveChangesAsync();

            await NotificationService.SendOutNewTrainingNotifications(users, newTrainingDto.NotificationContent,
                                                                      trainingwithId);
        }
        public static DTO.UserInTraining Map(DAL.App.DTO.UserInTraining userInTraining)
        {
            var returned = new DTO.UserInTraining
            {
                Id = userInTraining.Id,
                AttendingTraining = userInTraining.AttendingTraining,
                TrainingId        = userInTraining.TrainingId,
                AppUserId         = userInTraining.AppUserId,
            };

            return(returned);
        }