I have some static helper class:
public static class Helper
{
public static bool IsNull<T>(this T value) where T : class
{
return (value == null);
}
public static bool NotNull<T>(this T value) where T : class
{
return (!value.IsNull<T>());
}
public static bool IsNullOrEmpty(this string value)
{
return string.IsNullOrEmpty(value);
}
public static bool NotNullAndNotEmpty(this string value)
{
return (!value.IsNullOrEmpty());
}
public static bool NotNullAndNotEmpty(this ICollection value)
{
return (value.NotNull<ICollection>() && (value.Count > 0));
}
public static bool IsNullOrEmpty(this ICollection value)
{
return (!value.NotNullAndNotEmpty());
}
}
It is comfortable (habit) for me to use this helper, but I am not sure that it is correctly (worth it). How about performance? Are there any other reasons to not use it?
IsNullOrEmpty
just replacing the same exact extension? \$\endgroup\$