/// <summary>Snippet for CommitAsync</summary> public async Task CommitAsync() { // Snippet: CommitAsync(string, IEnumerable<Write>, CallSettings) // Additional: CommitAsync(string, IEnumerable<Write>, CancellationToken) // Create client FirestoreClient firestoreClient = await FirestoreClient.CreateAsync(); // Initialize request argument(s) string database = ""; IEnumerable <Write> writes = new Write[] { new Write(), }; // Make the request CommitResponse response = await firestoreClient.CommitAsync(database, writes); // End snippet }
/// <summary>Snippet for CommitAsync</summary> public async Task CommitAsync() { // Snippet: CommitAsync(string,IEnumerable<Write>,CallSettings) // Additional: CommitAsync(string,IEnumerable<Write>,CancellationToken) // Create client FirestoreClient firestoreClient = await FirestoreClient.CreateAsync(); // Initialize request argument(s) string formattedDatabase = new DatabaseRootName("[PROJECT]", "[DATABASE]").ToString(); IEnumerable <Write> writes = new List <Write>(); // Make the request CommitResponse response = await firestoreClient.CommitAsync(formattedDatabase, writes); // End snippet }
/// <summary>Snippet for CommitAsync</summary> public async Task CommitAsync_RequestObject() { // Snippet: CommitAsync(CommitRequest,CallSettings) // Create client FirestoreClient firestoreClient = await FirestoreClient.CreateAsync(); // Initialize request argument(s) CommitRequest request = new CommitRequest { Database = new DatabaseRootName("[PROJECT]", "[DATABASE]").ToString(), Writes = { }, }; // Make the request CommitResponse response = await firestoreClient.CommitAsync(request); // End snippet }
/// <summary>Snippet for CommitAsync</summary> public async Task CommitRequestObjectAsync() { // Snippet: CommitAsync(CommitRequest, CallSettings) // Additional: CommitAsync(CommitRequest, CancellationToken) // Create client FirestoreClient firestoreClient = await FirestoreClient.CreateAsync(); // Initialize request argument(s) CommitRequest request = new CommitRequest { Database = "", Writes = { new Write(), }, Transaction = ByteString.Empty, }; // Make the request CommitResponse response = await firestoreClient.CommitAsync(request); // End snippet }