Moves SqlNullableEquals to SqlExpressionExtensions
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user