Esempio n. 1
0
        public IEnumerable <Memo> FindInRangeByLecturesHours(int from, int to)
        {
            if (from < 0 || to < 0)
            {
                throw new ArgumentException($"From/To parameter should be >= 0");
            }
            if (from > to)
            {
                throw new ArgumentException($"Parameter 'From' should be <= 'To'");
            }

            var entities = _repository.Find(x => x.LectureHours >= from && x.LectureHours <= to).OrderBy(x => x.LectureHours);

            return(Mapper.Map <IEnumerable <Memo> >(entities.Where(x => x.UserId == _userService.CurrentUserId)));
        }