Skip to content

Commit 63748be

Browse files
committed
Mark .IsNullReference() extension [Obsolete]
1 parent f7235f7 commit 63748be

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Orm/Xtensive.Orm/Sql/Dml/Extensions.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
// Created by: Denis Krjuchkov
55
// Created: 2009.08.24
66

7+
using System;
78
using System.Text;
89

910
namespace Xtensive.Sql.Dml
@@ -13,6 +14,22 @@ namespace Xtensive.Sql.Dml
1314
/// </summary>
1415
public static class Extensions
1516
{
17+
/// <summary>
18+
/// Determines whether the specified expression is a null reference.
19+
/// Use this method instead of comparison with null,
20+
/// because equality operator is overloaded for <see cref="SqlExpression"/>
21+
/// to yield equality comparison expression.
22+
/// </summary>
23+
/// <param name="expression">The expression to check.</param>
24+
/// <returns>
25+
/// <see langword="true"/> if argument is a null reference; otherwise, <see langword="false"/>.
26+
/// </returns>
27+
[Obsolete(@"Use 'is null' operator")]
28+
public static bool IsNullReference(this SqlExpression expression)
29+
{
30+
return ReferenceEquals(expression, null);
31+
}
32+
1633
/// <summary>
1734
/// Checks whether <paramref name="available"/> contains all flags of given <paramref name="required"/>.
1835
/// </summary>

0 commit comments

Comments
 (0)