Exemplo n.º 1
0
        public long Count(UserEntity userEntity, SearchInternshipCourseEntity SearchInternshipCourseEntity)
        {
            if (SearchInternshipCourseEntity == null)
            {
                SearchInternshipCourseEntity = new SearchInternshipCourseEntity();
            }
            IQueryable <InternshipCourse> InternshipCourse = IMSContext.InternshipCourses;

            InternshipCourse = SearchInternshipCourseEntity.ApplyTo(InternshipCourse);
            return(InternshipCourse.Count());
        }
Exemplo n.º 2
0
        //Get Using filter
        public List <InternshipCourseEntity> Get(UserEntity UserEntity, SearchInternshipCourseEntity SearchInternshipCourseEntity)
        {
            if (SearchInternshipCourseEntity == null)
            {
                SearchInternshipCourseEntity = new SearchInternshipCourseEntity();
            }
            IQueryable <InternshipCourse> InternshipCourse = IMSContext.InternshipCourses
                                                             .Include(tf => tf.Student)
                                                             .Include(tf => tf.Company)
                                                             .Include(tf => tf.InternReports);

            InternshipCourse = SearchInternshipCourseEntity.ApplyTo(InternshipCourse);
            InternshipCourse = SearchInternshipCourseEntity.SkipAndTake(InternshipCourse);
            return(InternshipCourse.ToList().Select(u => new InternshipCourseEntity(u, u.Student, u.Company, u.InternReports)).ToList());
        }