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
TResultThe 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(bool, TResult, Exception)
Initializes a new instance of the ConditionalValue<TResult> class.
protected ConditionalValue(bool succeeded, TResult result, Exception failure)
Parameters
succeededboolIndicates whether the operation was successful (an instance of
TResulthas been created) or not.resultTResultThe value returned from the operation; otherwise the default value for
TResultof theresultparameter.failureExceptionThe 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.