Stay organized with collections
Save and categorize content based on your preferences.
Firebase.Database.TransactionResult
Instances of this class represent the desired outcome of a single Run of a transaction.
Summary
Pass a handler to DatabaseReference.RunTransaction, and in your handler, you can either:
Properties
|
IsSuccess
|
bool
Whether or not this result is a success.
|
Properties
IsSuccess
bool IsSuccess
Whether or not this result is a success.
Public static functions
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2021-06-17 UTC.
[null,null,["Last updated 2021-06-17 UTC."],[],[],null,["# Firebase.Database.TransactionResult Class Reference\n\nFirebase.Database.TransactionResult\n===================================\n\nInstances of this class represent the desired outcome of a single Run of a transaction.\n\nSummary\n-------\n\nPass a handler to [DatabaseReference.RunTransaction](/docs/reference/unity/class/firebase/database/database-reference#class_firebase_1_1_database_1_1_database_reference_1a4b21a7318e923a839b8fcca6ca3e90b0), and in your handler, you can either:\n\n- Set the data to the new value (success) via [TransactionResult.Success(MutableData)](/docs/reference/unity/class/firebase/database/transaction-result#class_firebase_1_1_database_1_1_transaction_result_1a6f1f1bf13de9df238709a34fda985ee6)\n- abort the transaction via [TransactionResult.Abort()](/docs/reference/unity/class/firebase/database/transaction-result#class_firebase_1_1_database_1_1_transaction_result_1a3fb9fa11dcea694892d9ee08950f6184)\n\n\u003cbr /\u003e\n\n| ### Properties ||\n|-----------------------------------------------------------------------------------------------------|-------------------------------------------------|\n| [IsSuccess](#class_firebase_1_1_database_1_1_transaction_result_1a5be2709b124540980c11f75fc691d0fc) | `bool` Whether or not this result is a success. |\n\n| ### Public static functions ||\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Abort](#class_firebase_1_1_database_1_1_transaction_result_1a3fb9fa11dcea694892d9ee08950f6184)`()` | [TransactionResult](/docs/reference/unity/class/firebase/database/transaction-result#class_firebase_1_1_database_1_1_transaction_result) Aborts the transaction run with [DatabaseReference.RunTransaction](/docs/reference/unity/class/firebase/database/database-reference#class_firebase_1_1_database_1_1_database_reference_1a4b21a7318e923a839b8fcca6ca3e90b0) and returns an aborted [TransactionResult](/docs/reference/unity/class/firebase/database/transaction-result#class_firebase_1_1_database_1_1_transaction_result) which can be returned from RunTransaction. |\n| [Success](#class_firebase_1_1_database_1_1_transaction_result_1a6f1f1bf13de9df238709a34fda985ee6)`(`[MutableData](/docs/reference/unity/class/firebase/database/mutable-data#class_firebase_1_1_database_1_1_mutable_data)` resultData)` | [TransactionResult](/docs/reference/unity/class/firebase/database/transaction-result#class_firebase_1_1_database_1_1_transaction_result) Builds a successful result to be returned from the handler passed to [DatabaseReference.RunTransaction](/docs/reference/unity/class/firebase/database/database-reference#class_firebase_1_1_database_1_1_database_reference_1a4b21a7318e923a839b8fcca6ca3e90b0). |\n\nProperties\n----------\n\n### IsSuccess\n\n```c#\nbool IsSuccess\n``` \nWhether or not this result is a success.\n\nPublic static functions\n-----------------------\n\n### Abort\n\n```c#\nTransactionResult Abort()\n``` \nAborts the transaction run with [DatabaseReference.RunTransaction](/docs/reference/unity/class/firebase/database/database-reference#class_firebase_1_1_database_1_1_database_reference_1a4b21a7318e923a839b8fcca6ca3e90b0) and returns an aborted [TransactionResult](/docs/reference/unity/class/firebase/database/transaction-result#class_firebase_1_1_database_1_1_transaction_result) which can be returned from RunTransaction. \n\n### Success\n\n```c#\nTransactionResult Success(\n MutableData resultData\n)\n``` \nBuilds a successful result to be returned from the handler passed to [DatabaseReference.RunTransaction](/docs/reference/unity/class/firebase/database/database-reference#class_firebase_1_1_database_1_1_database_reference_1a4b21a7318e923a839b8fcca6ca3e90b0).\n\n\u003cbr /\u003e\n\n| Details ||\n|-------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Parameters | |--------------|------------------------------------------------| | `resultData` | The desired data to be stored at the location. | |\n| **Returns** | A [TransactionResult](/docs/reference/unity/class/firebase/database/transaction-result#class_firebase_1_1_database_1_1_transaction_result) indicating the new data to be stored at the location. |"]]