public async Task <List <dynamic> > GetAddressWithPostCodeAsync() { var collectionUri = DocumentDBHelper.CreateAddressDocumentCollectionUri(); var client = DocumentDBClient.CreateDocumentClient(); var addressesWithVenuePostcodesQuery = client ?.CreateDocumentQuery <Address>(collectionUri, new FeedOptions { MaxItemCount = 1000 }) .Where(x => x.PostCode != null && x.Latitude == null && x.Longitude == null) .AsDocumentQuery(); if (addressesWithVenuePostcodesQuery == null) { return(null); } var addresses = new List <dynamic>(); while (addressesWithVenuePostcodesQuery.HasMoreResults) { var response = await addressesWithVenuePostcodesQuery.ExecuteNextAsync(); addresses.AddRange(response); } return(addresses.Any() ? addresses : null); }