public static TV TryParseToNull <TV>(this string obj, TryWithOutFunc <string, TV> func) where TV : class { TV v; return(obj == null ? null : func(obj, out v) ? v : null); }
public static TV?TryParseToNullable <TV>(this string obj, TryWithOutFunc <string, TV> func) where TV : struct { TV v; return(func(obj, out v) ? v : (TV?)null); }