Struct GetValueResult
Represents the outcome of TryGetValueAsync(String, CancellationToken)
Implements
Inherited Members
Namespace: ZptSharp.Expressions
Assembly: ZptSharp.Abstractions.dll
Syntax
public struct GetValueResult : IEquatable<GetValueResult>
Constructors
| Improve this Doc View SourceGetValueResult(Boolean, Object)
Initializes a new instance of the GetValueResult struct.
Declaration
public GetValueResult(bool success, object result)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | success | If set to |
System.Object | result | The retrieved result. |
Properties
| Improve this Doc View SourceFailure
Gets a GetValueResult which indicates failure to retrieve a result.
Declaration
public static GetValueResult Failure { get; }
Property Value
Type | Description |
---|---|
GetValueResult | A failure result. |
Success
Gets a value indicating whether a value was successfully retrieved or not.
Declaration
public bool Success { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Value
Gets the value which was retrieved, or a null reference if Success is false
.
Declaration
public object Value { get; }
Property Value
Type | Description |
---|---|
System.Object | The retrieved result. |
Methods
| Improve this Doc View SourceEquals(GetValueResult)
Determines whether the specified GetValueResult is equal to the current GetValueResult.
Declaration
public bool Equals(GetValueResult other)
Parameters
Type | Name | Description |
---|---|---|
GetValueResult | other | The GetValueResult to compare with the current GetValueResult. |
Returns
Type | Description |
---|---|
System.Boolean |
|
For(Object)
Gets a GetValueResult which indicates that the specified
result
object was successfully retrieved.
Declaration
public static GetValueResult For(object result)
Parameters
Type | Name | Description |
---|---|---|
System.Object | result | The result object. |
Returns
Type | Description |
---|---|
GetValueResult | A get-value result. |