CSLA.NET 5.4.2
CSLA .NET is a software development framework that helps you build a reusable, maintainable object-oriented business layer for your app.
ReferenceComparer.cs
Go to the documentation of this file.
1//-----------------------------------------------------------------------
2// <copyright file="ReferenceComparer.cs" company="Marimer LLC">
3// Copyright (c) Marimer LLC. All rights reserved.
4// Website: https://cslanet.com
5// </copyright>
6// <summary>Implements an equality comparer for <see cref="IMobileObject" /> that compares</summary>
7//-----------------------------------------------------------------------
8using System;
9using System.Collections.Generic;
10using System.Linq;
11using System.Text;
12
14{
20 public sealed class ReferenceComparer<T> : IEqualityComparer<T>
21 {
22 #region IEqualityComparer<T> Members
23
29 public bool Equals(T x, T y)
30 {
31 return Object.ReferenceEquals(x, y);
32 }
33
38 public int GetHashCode(T obj)
39 {
40 return obj.GetHashCode();
41 }
42
43 #endregion
44 }
45}
Implements an equality comparer for IMobileObject that compares the objects only on the basis is the ...
int GetHashCode(T obj)
Gets the hash code value for the object.
bool Equals(T x, T y)
Determines if the two objects are reference-equal.