public virtual IGroupedCollection <TEntity> Clone() { var grouped = new GroupedCollection <TEntity, TCollection>(Cache, Comparer, ItemsLoader); grouped.UniqueKeyComparer = UniqueKeyComparer; return(grouped); }
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)); }
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); }