IsEmpty / IsNotEmpty

public static bool IsEmpty<T>(this T value) where T : struct {
 return value.Equals(default(T));
}

public static bool IsNotEmpty<T>(this T value) where T : struct {
 return (value.IsEmpty() == false);
}
Example:
var dt = DateTime.MinValue;
if(dt.IsEmpty()) {
 ...
}

Description

Checks if any value type is empty.

Details

Double click on the code to select all.

 

;