Table of Contents

Method GetValueOrDefault

Namespace
Skyline.DataMiner.Core.DataMinerSystem.Common
Assembly
Skyline.DataMiner.Core.DataMinerSystem.Common.dll

GetValueOrDefault<T>(IDmsColumn<T?>, string, T)

Gets the cell value or the specified default value.

[Obsolete("Use the overload with the additional KeyType argument instead.")]
public static T GetValueOrDefault<T>(this IDmsColumn<T?> column, string key, T defaultValue) where T : struct

Parameters

column IDmsColumn<T?>

The column.

key string

The key.

defaultValue T

The value to return if the HasValue property returns false.

Returns

T

The parameter value.

Type Parameters

T

The type of the values the column holds.

Remarks

The key is assumed to be the display key. If no display key was found with the specified value, but a row exists with a primary key with the specified value, then the value of that row will be returned (only the case when the naming option or NamingFormat is in the protocol XML is used, not for the deprecated displayColumn attribute).

Do not use this call with primary keys in case the primary key value is also used as display key of another row.

This overload is deprecated. Use the overload with the additional KeyType argument instead.

Exceptions

ArgumentNullException

column or key is null.

ArgumentException

key is empty ("") or white space.

ElementStoppedException

The element is stopped.

ElementNotFoundException

The element was not found in the DataMiner System.

ParameterNotFoundException

The parameter was not found.

GetValueOrDefault<T>(IDmsColumn<T?>, string)

Gets the cell value or the specified default value.

[Obsolete("Use the overload with the additional KeyType argument instead.")]
public static T GetValueOrDefault<T>(this IDmsColumn<T?> column, string key) where T : struct

Parameters

column IDmsColumn<T?>

The column.

key string

The key.

Returns

T

The parameter value.

Type Parameters

T

The type of the values the column holds.

Remarks

The key is assumed to be the display key. If no display key was found with the specified value, but a row exists with a primary key with the specified value, then the value of that row will be returned (only the case when the naming option or NamingFormat is in the protocol XML is used, not for the deprecated displayColumn attribute).

Do not use this call with primary keys in case the primary key value is also used as display key of another row.

This overload is deprecated. Use the overload with the additional KeyType argument instead.

Exceptions

ArgumentNullException

column or key is null.

ArgumentException

key is empty ("") or white space.

ElementStoppedException

The element is stopped.

ElementNotFoundException

The element was not found in the DataMiner System.

ParameterNotFoundException

The parameter was not found.

GetValueOrDefault<T>(IDmsColumn<T?>, string, KeyType, T)

Gets the cell value or the specified default value.

public static T GetValueOrDefault<T>(this IDmsColumn<T?> column, string key, KeyType keyType, T defaultValue) where T : struct

Parameters

column IDmsColumn<T?>

The column.

key string

The key.

keyType KeyType

The key type.

defaultValue T

The value to return if the HasValue property returns false.

Returns

T

The parameter value.

Type Parameters

T

The type of the values the column holds.

Exceptions

ArgumentNullException

column or key is null.

ArgumentException

key is empty ("") or white space.

ElementStoppedException

The element is stopped.

ElementNotFoundException

The element was not found in the DataMiner System.

ParameterNotFoundException

The parameter was not found.

GetValueOrDefault<T>(IDmsColumn<T?>, string, KeyType)

Gets the cell value or the specified default value.

public static T GetValueOrDefault<T>(this IDmsColumn<T?> column, string key, KeyType keyType) where T : struct

Parameters

column IDmsColumn<T?>

The column.

key string

The key.

keyType KeyType

The key type.

Returns

T

The parameter value.

Type Parameters

T

The type of the values the column holds.

Exceptions

ArgumentNullException

column or key is null.

ArgumentException

key is empty ("") or white space.

ElementStoppedException

The element is stopped.

ElementNotFoundException

The element was not found in the DataMiner System.

ParameterNotFoundException

The parameter was not found.