You can use this to check null
public static bool CheckNullOrEmpty<T>(T value)
{
if (typeof(T) == typeof(string))
return string.IsNullOrEmpty(value as string);
return value == null || value.Equals(default(T));
}
Comments
Post a Comment