예제 #1
0
        public virtual IGroupedCollection <TEntity> Clone()
        {
            var grouped = new GroupedCollection <TEntity, TCollection>(Cache, Comparer, ItemsLoader);

            grouped.UniqueKeyComparer = UniqueKeyComparer;
            return(grouped);
        }
예제 #2
0
        public static GroupedCollection <TEntity, GroupedCollection <TEntity, TCollection> > SplitBy <TEntity, TCollection>(
            this GroupedCollection <TEntity, TCollection> collection,
            Type[] byFields,
            GroupItemsLoadHandler <TEntity> itemLoader)
            where TEntity : class, IBqlTable, new()
            where TCollection : ICollection <TEntity>, new()
        {
            var groupComparer = new KeyValuesComparer <TEntity>(collection.Cache, byFields);

            return(new UpperGroupedCollection <TEntity, GroupedCollection <TEntity, TCollection> >(groupComparer, itemLoader, collection));
        }
예제 #3
0
        public static GroupedCollection <TEntity, TCollection> SplitBy <TEntity, TCollection>(
            this TCollection collection,
            PXCache <TEntity> cache,
            Type[] byFields)
            where TEntity : class, IBqlTable, new()
            where TCollection : ICollection <TEntity>, new()
        {
            var groupComparer = new KeyValuesComparer <TEntity>(cache, byFields);

            var uniqueKeyComparer = new KeyValuesComparer <TEntity>(cache, cache.BqlKeys);

            var grouped = new GroupedCollection <TEntity, TCollection>(cache, groupComparer);

            grouped.UniqueKeyComparer = uniqueKeyComparer;

            return(grouped);
        }