Skip to content

TransactionResult

Namespace: ThinkGeo.Core

This class represents the results of a transaction that was processed.

public class TransactionResult

Inheritance objectTransactionResult

Remarks:

The result keeps track of how many operations succeeded or failed and stores the individual failure reasons keyed by feature identifier. Surface as much detail as possible so calling code can diagnose and recover from issues.

Properties

TotalSuccessCount

Gets or sets the total number of records that were committed successfully.

public int TotalSuccessCount { get; set; }

Property Value

int
The count of operations that completed without errors.

TotalFailureCount

Gets or sets the total number of records that failed during the transaction.

public int TotalFailureCount { get; set; }

Property Value

int
The count of operations that did not complete successfully.

TransactionResultStatus

Gets or sets the overall outcome of the transaction.

public TransactionResultStatus TransactionResultStatus { get; set; }

Property Value

TransactionResultStatus
A indicating success, failure, or partial success.

Remarks:

This property returns the results of the transaction. If all of the records committed fine then you get a success status. If any of the records fail then you get a failure status though some of the records may have committed.

FailureReasons

Gets the failure reasons keyed by feature identifier.

public Dictionary<string, string> FailureReasons { get; }

Property Value

Dictionary<string, string>
A dictionary mapping a feature ID to the corresponding failure message.

Remarks:

If there are failing records we suggest you add the failure reasons to this dictionary. It is also suggested that you use the FeatureId as the key of the Dictionary.

Constructors

TransactionResult()

Initializes a new instance of the TransactionResult class.

public TransactionResult()

Remarks:

This overload seeds the result with default values (success with no failures).

TransactionResult(int, int, Dictionary<string, string>, TransactionResultStatus)

Initializes a new instance of the TransactionResult class using the provided counts.

public TransactionResult(int totalSuccessCount, int totalFailureCount, Dictionary<string, string> failureReasons, TransactionResultStatus transactionResultStatus)

Parameters

totalSuccessCount int
The number of operations that completed successfully.

totalFailureCount int
The number of operations that failed.

failureReasons Dictionary<string, string>
Failure reasons keyed by feature identifier.

transactionResultStatus TransactionResultStatus
Overall transaction status.