<PackageReference Include="Relativity.Server.Utility.SDK" Version="5000.0.0" />

kCura.Utility.CronSchedule.ValueOrError<T>

public struct ValueOrError<T>
Wraps the result of an operation that may have failed, providing access to either the result or the error that occurred.
public Exception Error { get; }

Gets the underlying Exception if this represents an error condition, otherwise it returns null.

Gets the underlying ExceptionProvider if this represents an error condition, otherwise it returns null.

public bool HasValue { get; }

Indicates whether or not this ValueOrError contains a value.

public bool IsError { get; }

Indicates whether or not this ValueOrError contains an error.

public T Value { get; }

Gets the value or underlying exception.

public ValueOrError(T value)

Initializes a new instance of ValueOrError backed by the provided value.

public ValueOrError(Exception error)

Initializes a new instance of ValueOrError backed by the provided exception.

Initializes a new instance of ValueOrError backed by an exception provider.

public static T op_Explicit(ValueOrError<T> ve)

Gets the value associated with this ValueOrError.

public static Exception op_Explicit(ValueOrError<T> ve)

Gets the exception associated with this ValueOrError.

Gets the ExceptionProvider associated with this ValueOrError.

public static ValueOrError<T> op_Implicit(T value)

Wraps the provided value in an instance of ValueOrError.

public static ValueOrError<T> op_Implicit(Exception error)

Wraps the provided exception in an instance of ValueOrError.

public static ValueOrError<T> op_Implicit(ExceptionProvider provider)

Wraps the provided ExceptionProvider in an instance of ValueOrError.

public T TryGetValue(T errorValue)

Gets the underlying value if it exists, otherwise returns .