public DynamicGrouping(DynamicPublishedContentList list, string groupBy)
 {
     Inner =
         list
         .Items
         .Select(node =>
     {
         string predicate = groupBy;
         var internalList = new DynamicPublishedContentList(new DynamicPublishedContent[] { node });
         var query        = (IQueryable <object>)internalList.Select(predicate, new object[] { });
         var key          = query.FirstOrDefault();
         return(new
         {
             Key = key,
             Node = node
         });
     })
         .Where(item => item.Key != null)
         .GroupBy(item => item.Key)
         .Select(item => new Grouping <object, DynamicPublishedContent>()
     {
         Key      = item.Key,
         Elements = item.Select(inner => inner.Node)
     });
 }
Пример #2
0
        public static IQueryable Select(this IEnumerable <IPublishedContent> list, string predicate, params object[] values)
        {
            var dList = new DynamicPublishedContentList(list);

            return(dList.Select(predicate));
        }
		public static IQueryable Select(this IEnumerable<IPublishedContent> list, string predicate, params object[] values)
		{
			var dList = new DynamicPublishedContentList(list);
			return dList.Select(predicate);
		}