public virtual AsyncPageable <MongoDBCollectionResource> GetAllAsync(CancellationToken cancellationToken = default) { async Task <Page <MongoDBCollectionResource> > FirstPageFunc(int?pageSizeHint) { using var scope = _mongoDBCollectionMongoDBResourcesClientDiagnostics.CreateScope("MongoDBCollectionCollection.GetAll"); scope.Start(); try { var response = await _mongoDBCollectionMongoDBResourcesRestClient.ListMongoDBCollectionsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken : cancellationToken).ConfigureAwait(false); return(Page.FromValues(response.Value.Value.Select(value => new MongoDBCollectionResource(Client, value)), null, response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } } return(PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null)); }