Beispiel #1
0
        public ProgramSchedule FindProgramForUser(User user)
        {
            var type     = _programTypeService.GetProgramTypes().SingleOrDefault(t => t.Name == user.ProgramTypeName);
            var schedule = _programScheduleRepository.Find(p => p.ProgramTypeId == type.Id);

            if (schedule != null)
            {
                _userScheduleService.AddNewUserProgramSchedule(user, schedule);
                return(schedule);
            }
            else
            {
                return(null);
            }
        }
        public IActionResult Get()
        {
            var programTypes = _programTypeService.GetProgramTypes();
            var rezult       = programTypes.Select(p => _mapper.Map <ProgramTypeDto>(p)).ToList();

            return(Ok(rezult));
        }