Class ConditionalValue<TResult>
- Namespace
- Cuemon
- Assembly
- Cuemon.Core.dll
Represents the base class to support the Try-Parse pattern of an operation that may be asynchronous in nature.
public abstract class ConditionalValue<TResult> : ConditionalValue
Type Parameters
TResult
The type of the return value of the operation.
- Inheritance
-
ConditionalValue<TResult>
- Derived
- Inherited Members
Remarks
Try-Parse pattern: https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/exceptions-and-performance
Constructors
ConditionalValue(Boolean, TResult, Exception)
Initializes a new instance of the ConditionalValue<TResult> class.
protected ConditionalValue(bool succeeded, TResult result, Exception failure)
Parameters
succeeded
BooleanIndicates whether the operation was successful (an instance of
TResult
has been created) or not.result
TResultThe value returned from the operation; otherwise the default value for
TResult
of theresult
parameter.failure
ExceptionThe Exception to associate with a faulted operation.
Properties
Result
Gets the result of the operation.
public TResult Result { get; }
Property Value
- TResult
The result of the operation.