KeyWrapper<TKey>

Namespace: ASPSecurityKit
Assembly: ASPSecurityKit.dll

Summary

Wrapper type to additionally represent null keys in generic dictionary which otherwise doesn’t support null keys.

Generic Types
Name Description
TKey Type of the key.

Members

NullKey

Summary

Gets an instance of KeyWrapper<TKey> representing the null value.

Constructors

#ctor(key)

Summary

Initializes a new instance of the KeyWrapper<TKey> struct.

Parameters
Name Type Description
key System.Nullable<TId> The key.

Properties

Key

Summary

Gets the key.

Value

The key.

IsNull

Summary

Gets a value indicating whether this instance represents a null key.

Value

true if this instance represents a null key; otherwise, false.

Methods

op_Implicit(keyWrapper)

Summary

Performs an implicit conversion from KeyWrapper<TKey> to Nullable<TKey>.

Returns

The result of the conversion.

Parameters
Name Type Description
keyWrapper ASPSecurityKit.KeyWrapper<TKey> The key wrapper.

op_Implicit(key)

Summary

Performs an implicit conversion from Nullable<TKey> to KeyWrapper<TKey>.

Returns

The result of the conversion.

Parameters
Name Type Description
key System.Nullable<TKey> The key.

ToString()

Summary

Converts to string. The null key is converted to empty string ("").

Returns

A String that represents this instance.

Parameters

This method has no parameters.

Equals(obj)

Summary

Indicates whether this instance and a specified object are equal.

Returns

true if obj and this instance are the same type and represent the same value; otherwise, false.

Parameters
Name Type Description
obj System.Object The KeyWrapper<TKey> instance to compare with.

GetHashCode()

Summary

Returns a hash code for this instance.

Returns

A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.

Parameters

This method has no parameters.

Remarks

Null key returns zero as the hash code. In other cases, the hash code is obtained from Key and then incrementing it by one if it’s a positive integer (zero or greater).