NullableExtensions Class
Extensions of Nullable types.
Namespace
Songhay.Extensions
Base Types
  • object
graph BT Type-->Base0["object"] Type["NullableExtensions"] class Type type-node

Syntax

public static class NullableExtensions

Methods

Name Return Value Summary
IsAssignableToISerializable<T>(T) bool
Determines whether the specified type can be assigned to System.Runtime.Serialization.ISerializable.
static
Round(decimal?, int) decimal
Rounds the specified decimal.
static
ThrowWhenNullOrEmpty<T>(IEnumerable<T>?, string) void
Throws an ArgumentNullException when the specified enumerable is null or empty.
static
ThrowWhenNullOrWhiteSpace(string, string) void
Throws an ArgumentNullException when System.String.IsNullOrWhiteSpace(System.String) is true.
static
ToObjectOrDbNull<T>(T) object
Boxes the nullable in object or returns DBNull.
static
ToReferenceTypeValueOrThrow<T>(T, string) T
Returns the non-null value of the specified, nullable reference type or throws an ArgumentNullException when the value is null.
static
ToValueOrThrow<T>(T?, string) T
Returns the non-null value of the specified value type or throws an ArgumentNullException when the value is null.
static