Пример #1
0
        /// <summary>Snippet for BeginTransactionAsync</summary>
        public async Task BeginTransactionAsync()
        {
            // Snippet: BeginTransactionAsync(string, CallSettings)
            // Additional: BeginTransactionAsync(string, CancellationToken)
            // Create client
            FirestoreClient firestoreClient = await FirestoreClient.CreateAsync();

            // Initialize request argument(s)
            string database = "";
            // Make the request
            BeginTransactionResponse response = await firestoreClient.BeginTransactionAsync(database);

            // End snippet
        }
        /// <summary>Snippet for BeginTransactionAsync</summary>
        public async Task BeginTransactionAsync()
        {
            // Snippet: BeginTransactionAsync(string,CallSettings)
            // Additional: BeginTransactionAsync(string,CancellationToken)
            // Create client
            FirestoreClient firestoreClient = await FirestoreClient.CreateAsync();

            // Initialize request argument(s)
            string formattedDatabase = new DatabaseRootName("[PROJECT]", "[DATABASE]").ToString();
            // Make the request
            BeginTransactionResponse response = await firestoreClient.BeginTransactionAsync(formattedDatabase);

            // End snippet
        }
        /// <summary>Snippet for BeginTransactionAsync</summary>
        public async Task BeginTransactionAsync_RequestObject()
        {
            // Snippet: BeginTransactionAsync(BeginTransactionRequest,CallSettings)
            // Create client
            FirestoreClient firestoreClient = await FirestoreClient.CreateAsync();

            // Initialize request argument(s)
            BeginTransactionRequest request = new BeginTransactionRequest
            {
                Database = new DatabaseRootName("[PROJECT]", "[DATABASE]").ToString(),
            };
            // Make the request
            BeginTransactionResponse response = await firestoreClient.BeginTransactionAsync(request);

            // End snippet
        }
Пример #4
0
        /// <summary>Snippet for BeginTransactionAsync</summary>
        public async Task BeginTransactionRequestObjectAsync()
        {
            // Snippet: BeginTransactionAsync(BeginTransactionRequest, CallSettings)
            // Additional: BeginTransactionAsync(BeginTransactionRequest, CancellationToken)
            // Create client
            FirestoreClient firestoreClient = await FirestoreClient.CreateAsync();

            // Initialize request argument(s)
            BeginTransactionRequest request = new BeginTransactionRequest
            {
                Database = "",
                Options  = new TransactionOptions(),
            };
            // Make the request
            BeginTransactionResponse response = await firestoreClient.BeginTransactionAsync(request);

            // End snippet
        }