private async Task <bool> AssembleAsync( CacheKey ck, object ce, ICollectionPersister persister, ISessionImplementor source, IPersistentCollection collection, object collectionKey, bool alterStatistics, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); ISessionFactoryImplementor factory = source.Factory; if (factory.Statistics.IsStatisticsEnabled && alterStatistics) { if (ce == null) { factory.StatisticsImplementor.SecondLevelCacheMiss(persister.Cache.RegionName); } else { factory.StatisticsImplementor.SecondLevelCacheHit(persister.Cache.RegionName); } } if (ce == null) { log.Debug("Collection cache miss: {0}", ck); } else { log.Debug("Collection cache hit: {0}", ck); } if (ce == null) { return(false); } else { IPersistenceContext persistenceContext = source.PersistenceContext; CollectionCacheEntry cacheEntry = (CollectionCacheEntry)persister.CacheEntryStructure.Destructure(ce, factory); await(cacheEntry.AssembleAsync(collection, persister, persistenceContext.GetCollectionOwner(collectionKey, persister), cancellationToken)).ConfigureAwait(false); persistenceContext.GetCollectionEntry(collection).PostInitialize(collection, persistenceContext); if (collection.HasQueuedOperations) { collection.ApplyQueuedOperations(); } return(true); } }