Moves SqlNullableEquals to SqlExpressionExtensions

This commit is contained in:
Shannon
2018-12-06 01:14:06 +11:00
parent a239d50e89
commit 85efd4dc59
3 changed files with 17 additions and 15 deletions

View File

@@ -788,19 +788,6 @@ namespace Umbraco.Core
return BoolConvertCache[type] = false;
}
/// <summary>
/// Indicates whether two nullable values are equal, substituting a fallback value for nulls.
/// </summary>
/// <typeparam name="T">The nullable type.</typeparam>
/// <param name="value">The value to compare.</param>
/// <param name="other">The value to compare to.</param>
/// <param name="fallbackValue">The value to use when any value is null.</param>
/// <remarks>Do not use outside of Sql expressions.</remarks>
// see usage in ExpressionVisitorBase
public static bool SqlNullableEquals<T>(this T? value, T? other, T fallbackValue)
where T : struct
{
return (value ?? fallbackValue).Equals(other ?? fallbackValue);
}
}
}