Converts an empty value to null.
public static Guid? EmptyToNull(this Guid val)
public static Guid? EmptyToNull(this Guid? val)
public static string EmptyToNull(this string val)
Guid or Guid? value to test if Empty GUID {00000000-0000-0000-0000-000000000000} and then convert to null if so, else return the GUID value.
String value to test if Empty string "" and then convert to null if so, else return the string value.
var g = Guid.Empty();Guid? result = g.EmptyToNull();