Connectivity Software User's Guide and Reference
ToNotNullValueResult<TValue> Method



OpcLabs.EasyOpcUAPrimitives Assembly > OpcLabs.EasyOpc.UA.OperationModel Namespace > UAAttributeDataResult Class : ToNotNullValueResult<TValue> Method
The target type for the value.
A function to transform exceptions before including them in the result.

The value of this parameter cannot be null (Nothing in Visual Basic).

A function that returns the operation arguments for error reporting.

The value of this parameter cannot be null (Nothing in Visual Basic).

Converts this attribute data result to a strongly-typed OpcLabs.BaseLib.OperationModel.Generic.ValueResult<T>, ensuring the status is good and the value is not null.
Syntax
'Declaration
 
<JetBrains.Annotations.NotNullAttribute()>
Public Function ToNotNullValueResult(Of TValue)( _
   ByVal exceptionTransformingFunction As Func(Of Exception,Exception), _
   ByVal getOperationArgumentsFunction As Func(Of OperationArguments) _
) As ValueResult(Of TValue)
'Usage
 
Dim instance As UAAttributeDataResult
Dim exceptionTransformingFunction As Func(Of Exception,Exception)
Dim getOperationArgumentsFunction As Func(Of OperationArguments)
Dim value As ValueResult(Of TValue)
 
value = instance.ToNotNullValueResult(Of TValue)(exceptionTransformingFunction, getOperationArgumentsFunction)

Parameters

exceptionTransformingFunction
A function to transform exceptions before including them in the result.

The value of this parameter cannot be null (Nothing in Visual Basic).

getOperationArgumentsFunction
A function that returns the operation arguments for error reporting.

The value of this parameter cannot be null (Nothing in Visual Basic).

Type Parameters

TValue
The target type for the value.

Return Value

A strongly-typed OpcLabs.BaseLib.OperationModel.Generic.ValueResult<T> with a non-null value of type TValue.

This method never returns null (Nothing in Visual Basic).

Remarks

This method ensures the status is good, converts the value to the specified type, and verifies the value is not null. If the value is null, an appropriate exception is created and transformed.

This method or property does not throw any exceptions, aside from execution exceptions such as System.Threading.ThreadAbortException or System.OutOfMemoryException.

Requirements

Target Platforms: .NET Framework: Windows 10 (selected versions), Windows 11 (selected versions), Windows Server 2016, Windows Server 2022; .NET: Linux, macOS, Microsoft Windows

See Also