Example #1
0
        public new IEnumerable <StudyPlan> Get()
        {
            var dtos = _context.Set <StudyPlanDto>()
                       //.Include(x => x.details)
                       .ToList();

            return(dtos.Select(dto => _mapper.Map <StudyPlan>(dto)).ToList());
        }
Example #2
0
        public IEnumerable <T> Get(string includeProperties = "")
        {
            IQueryable <TY> dtos = _context.Set <TY>();

            if (!string.IsNullOrEmpty(includeProperties))
            {
                foreach (string includeProperty in includeProperties.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
                {
                    dtos = dtos.Include(includeProperty);
                }
            }

            return(dtos.Select(dto => _mapper.Map <T>(dto)).ToList());
        }