ValueOrError Struct

Namespace:
Weavy.Core.Cron
Assembly:
Weavy.Core.dll

A generic type that either represents a value or an error condition.

public struct ValueOrError

Constructors

ValueOrError(Exception) Initializes the object with an error.
ValueOrError(ExceptionProvider) Initializes the object with a handler that will provide the error result when needed.
ValueOrError(T) Initializes the object with a defined value.

Properties

Error Gets the System.Exception object if this object represents an error condition otherwise it returns null.
ErrorProvider Gets the Weavy.Core.Cron.ExceptionProvider object if this object represents an error condition otherwise it returns null.
HasValue Determines if object holds a defined value or not.
IsError Determines if object identifies an error condition or not.
Value Gets the value otherwise throws an error if undefined.

Methods

ToString()
TryGetValue(T) Attempts to get the defined value or another in case of an error.

Extension Methods

IsNullOrDefault(T) Gets a value indicating if the specified value has the default value of the generic type.
Serialize(Object) Serializes an object, or graph of connected objects, to a byte array.
SerializeToJson(Object, Nullable, JsonSerializerSettings) Serializes an object, or graph of connected objects, to a json string.
IsValid(Object) Determines whether the specified object is valid by evaluating each ValidationAttribute instance that is attached to the object type.