Ejemplo n.º 1
0
        public IList <IComponent> FindComponents(IQuery queryParameters)
        {
            LoggerService.Debug(">>FindComponents ({0})", LoggingCategory.Performance, queryParameters.ToString());

            var results = ComponentProvider.FindComponents(queryParameters)
                          .Select(c => { IComponent comp = null; TryGetComponent(c, out comp); return(comp); })
                          .Where(c => c != null)
                          .ToList();

            LoggerService.Debug("<<FindComponents ({0})", LoggingCategory.Performance, queryParameters.ToString());
            return(results);
        }
Ejemplo n.º 2
0
        public IList <IComponent> FindComponents(IQuery queryParameters, int pageIndex, int pageSize, out int totalCount)
        {
            LoggerService.Debug(">>FindComponents ({0},{1})", LoggingCategory.Performance, queryParameters.ToString(), Convert.ToString(pageIndex));
            totalCount = 0;
            IList <string> results = ComponentProvider.FindComponents(queryParameters);

            totalCount = results.Count;

            var pagedResults = results
                               .Skip(pageIndex * pageSize)
                               .Take(pageSize)
                               .Select(c => { IComponent comp = null; TryGetComponent(c, out comp); return(comp); })
                               .Where(c => c != null)
                               .ToList();

            LoggerService.Debug("<<FindComponents ({0},{1})", LoggingCategory.Performance, queryParameters.ToString(), Convert.ToString(pageIndex));
            return(pagedResults);
        }