/// <summary>Snippet for RunQuery</summary> public async Task RunQuery() { // Snippet: RunQuery(RunQueryRequest,CallSettings) // Create client FirestoreClient firestoreClient = FirestoreClient.Create(); // Initialize request argument RunQueryRequest request = new RunQueryRequest { Parent = new AnyPathName("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]").ToString(), }; // Make the request, returning a streaming response FirestoreClient.RunQueryStream streamingResponse = firestoreClient.RunQuery(request); // Read streaming responses from server until complete IAsyncEnumerator <RunQueryResponse> responseStream = streamingResponse.ResponseStream; while (await responseStream.MoveNext()) { RunQueryResponse response = responseStream.Current; // Do something with streamed response } // The response stream has completed // End snippet }
/// <summary>Snippet for RunQuery</summary> public async Task RunQueryRequestObject() { // Snippet: RunQuery(RunQueryRequest, CallSettings) // Create client FirestoreClient firestoreClient = FirestoreClient.Create(); // Initialize request argument(s) RunQueryRequest request = new RunQueryRequest { Parent = "", StructuredQuery = new StructuredQuery(), Transaction = ByteString.Empty, }; // Make the request, returning a streaming response FirestoreClient.RunQueryStream response = firestoreClient.RunQuery(request); // Read streaming responses from server until complete // Note that C# 8 code can use await foreach AsyncResponseStream <RunQueryResponse> responseStream = response.GetResponseStream(); while (await responseStream.MoveNextAsync()) { RunQueryResponse responseItem = responseStream.Current; // Do something with streamed response } // The response stream has completed // End snippet }