private async Task EvictCachedCollectionsAsync(IType[] types, object id, ISessionFactoryImplementor factory, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); for (int i = 0; i < types.Length; i++) { if (types[i].IsCollectionType) { await(factory.EvictCollectionAsync(((CollectionType)types[i]).Role, id, cancellationToken)).ConfigureAwait(false); } else if (types[i].IsComponentType) { IAbstractComponentType actype = (IAbstractComponentType)types[i]; await(EvictCachedCollectionsAsync(actype.Subtypes, id, factory, cancellationToken)).ConfigureAwait(false); } } }