Skip to content

Commit dfe5dec

Browse files
committed
Obsolete EqualsHelper
1 parent 7af6f4c commit dfe5dec

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

src/NHibernate.DomainModel/Async/CustomPersister.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public Task<int[]> FindDirtyAsync(object[] currentState, object[] previousState,
3737
{
3838
try
3939
{
40-
if (!EqualsHelper.Equals(currentState[0], previousState[0]))
40+
if (!Equals(currentState[0], previousState[0]))
4141
{
4242
return Task.FromResult<int[]>(new int[] { 0 });
4343
}
@@ -56,7 +56,7 @@ public Task<int[]> FindModifiedAsync(object[] old, object[] current, object enti
5656
{
5757
try
5858
{
59-
if (!EqualsHelper.Equals(old[0], current[0]))
59+
if (!Equals(old[0], current[0]))
6060
{
6161
return Task.FromResult<int[]>(new int[] { 0 });
6262
}

src/NHibernate.DomainModel/CustomPersister.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ public IType GetPropertyType(string propertyName)
254254

255255
public int[] FindDirty(object[] currentState, object[] previousState, object entity, ISessionImplementor session)
256256
{
257-
if (!EqualsHelper.Equals(currentState[0], previousState[0]))
257+
if (!Equals(currentState[0], previousState[0]))
258258
{
259259
return new int[] { 0 };
260260
}
@@ -266,7 +266,7 @@ public int[] FindDirty(object[] currentState, object[] previousState, object ent
266266

267267
public int[] FindModified(object[] old, object[] current, object entity, ISessionImplementor session)
268268
{
269-
if (!EqualsHelper.Equals(old[0], current[0]))
269+
if (!Equals(old[0], current[0]))
270270
{
271271
return new int[] { 0 };
272272
}

src/NHibernate/Type/AbstractType.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ public virtual bool IsSame(object x, object y)
208208

209209
public virtual bool IsEqual(object x, object y)
210210
{
211-
return EqualsHelper.Equals(x, y);
211+
return Equals(x, y);
212212
}
213213

214214
public virtual bool IsEqual(object x, object y, ISessionFactoryImplementor factory)

src/NHibernate/Type/NullableType.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ public override bool[] ToColumnNullness(object value, IMapping mapping)
332332

333333
public override bool IsEqual(object x, object y)
334334
{
335-
return EqualsHelper.Equals(x, y);
335+
return Equals(x, y);
336336
}
337337

338338
#region override of System.Object Members

src/NHibernate/Util/EqualsHelper.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
using System;
2+
13
namespace NHibernate.Util
24
{
35
public static class EqualsHelper
46
{
7+
[Obsolete("Please use object.Equals(object, object) instead.")]
58
public new static bool Equals(object x, object y)
69
{
7-
return x == y || (x != null && y != null && x.Equals(y));
10+
return object.Equals(x, y);
811
}
912
}
1013
}

0 commit comments

Comments
 (0)