public void deleteUserVacationRequest(DateTime startDate, DateTime endDate)
        {
            //change this
            var currentVacationRequest = _userVacationRequestRepository.FindByCondition(x => x.StartDate == startDate && x.EndDate == endDate).First();

            _userVacationRequestRepository.Delete(currentVacationRequest);
            _userVacationRequestRepository.Save();
        }
        public void CreateVacationRequest(UserVacationRequestDTO userVacationRequestDTO)
        {
            Mapper.Reset();
            Mapper.Initialize(x => x.CreateMap <UserVacationRequestDTO, UserVacationRequest>()
                              .ForMember("VacationType", opt => opt.MapFrom(c => _vacationTypeRepository.FindByCondition(y => y.Name == userVacationRequestDTO.VacationType).First()))
                              .ForMember("User", opt => opt.MapFrom(user => _userRepository.GetById(userVacationRequestDTO.User)))
                              .ForMember("Status", opt => opt.MapFrom(statuses => 1))
                              );
            var result = Mapper.Map <UserVacationRequestDTO, UserVacationRequest>(userVacationRequestDTO);

            if (userVacationRequestDTO.StartDate < userVacationRequestDTO.EndDate)
            {
                List <bool> checkOverlaps   = CheckDublicate(result);
                var         daysForVacation = CheckVacationPolicies(result);
                if (!checkOverlaps.Contains(true) && daysForVacation != null)
                {
                    result.Payment = daysForVacation.Payments;
                    _userVacationRequestRepository.Create(result);
                    _userVacationRequestRepository.Save();
                }
            }
        }