@@ -233,25 +233,38 @@ public DateTime UploadDate
233
233
234
234
// public operators
235
235
/// <summary>
236
- /// Compares two MongoGridFSFileInfos .
236
+ /// Determines whether two specified MongoGridFSFileInfo objects have different values .
237
237
/// </summary>
238
- /// <param name="lhs">The first MongoGridFSFileInfo .</param>
239
- /// <param name="rhs">The other MongoGridFSFileInfo .</param>
240
- /// <returns>True if the two MongoGridFSFileInfos are not equal (or one is null and the other is not) .</returns>
238
+ /// <param name="lhs">The first value to compare, or null .</param>
239
+ /// <param name="rhs">The second value to compare, or null .</param>
240
+ /// <returns>True if the value of lhs is different from the value of rhs; otherwise, false .</returns>
241
241
public static bool operator != ( MongoGridFSFileInfo lhs , MongoGridFSFileInfo rhs )
242
242
{
243
- return ! ( lhs == rhs ) ;
243
+ return ! MongoGridFSFileInfo . Equals ( lhs , rhs ) ;
244
244
}
245
245
246
246
/// <summary>
247
- /// Compares two MongoGridFSFileInfos .
247
+ /// Determines whether two specified MongoGridFSFileInfo objects have the same value .
248
248
/// </summary>
249
- /// <param name="lhs">The first MongoGridFSFileInfo .</param>
250
- /// <param name="rhs">The other MongoGridFSFileInfo .</param>
251
- /// <returns>True if the two MongoGridFSFileInfos are equal (or both null) .</returns>
249
+ /// <param name="lhs">The first value to compare, or null .</param>
250
+ /// <param name="rhs">The second value to compare, or null .</param>
251
+ /// <returns>True if the value of lhs is the same as the value of rhs; otherwise, false .</returns>
252
252
public static bool operator == ( MongoGridFSFileInfo lhs , MongoGridFSFileInfo rhs )
253
253
{
254
- return object . Equals ( lhs , rhs ) ;
254
+ return MongoGridFSFileInfo . Equals ( lhs , rhs ) ;
255
+ }
256
+
257
+ // public static methods
258
+ /// <summary>
259
+ /// Determines whether two specified MongoGridFSFileInfo objects have the same value.
260
+ /// </summary>
261
+ /// <param name="lhs">The first value to compare, or null.</param>
262
+ /// <param name="rhs">The second value to compare, or null.</param>
263
+ /// <returns>True if the value of lhs is the same as the value of rhs; otherwise, false.</returns>
264
+ public static bool Equals ( MongoGridFSFileInfo lhs , MongoGridFSFileInfo rhs )
265
+ {
266
+ if ( ( object ) lhs == null ) { return ( object ) rhs == null ; }
267
+ return lhs . Equals ( rhs ) ;
255
268
}
256
269
257
270
// public methods
@@ -334,13 +347,14 @@ public void Delete()
334
347
}
335
348
336
349
/// <summary>
337
- /// Compares this MongoGridFSFileInfo to another MongoGridFSFileInfo.
350
+ /// Determines whether this instance and another specified MongoGridFSFileInfo object have the same value .
338
351
/// </summary>
339
- /// <param name="rhs">The other MongoGridFSFileInfo.</param>
340
- /// <returns>True if the two MongoGridFSFileInfos are equal .</returns>
352
+ /// <param name="rhs">The MongoGridFSFileInfo object to compare to this instance .</param>
353
+ /// <returns>True if the value of the rhs parameter is the same as this instance; otherwise, false .</returns>
341
354
public bool Equals ( MongoGridFSFileInfo rhs )
342
355
{
343
- if ( object . ReferenceEquals ( rhs , null ) || GetType ( ) != rhs . GetType ( ) ) { return false ; }
356
+ if ( ( object ) rhs == null || GetType ( ) != rhs . GetType ( ) ) { return false ; }
357
+ if ( ( object ) this == ( object ) rhs ) { return true ; }
344
358
return
345
359
( _aliases == null && rhs . _aliases == null || _aliases != null && rhs . _aliases != null && _aliases . SequenceEqual ( rhs . _aliases ) ) &&
346
360
_chunkSize == rhs . _chunkSize &&
@@ -354,19 +368,19 @@ public bool Equals(MongoGridFSFileInfo rhs)
354
368
}
355
369
356
370
/// <summary>
357
- /// Compares this MongoGridFSFileInfo to another object.
371
+ /// Determines whether this instance and a specified object, which must also be a MongoGridFSFileInfo object, have the same value .
358
372
/// </summary>
359
- /// <param name="obj">The other object.</param>
360
- /// <returns>True if the other object is a MongoGridFSFileInfo and equal to this one .</returns>
373
+ /// <param name="obj">The MongoGridFSFileInfo object to compare to this instance .</param>
374
+ /// <returns>True if obj is a MongoGridFSFileInfo object and its value is the same as this instance; otherwise, false .</returns>
361
375
public override bool Equals ( object obj )
362
376
{
363
377
return Equals ( obj as MongoGridFSFileInfo ) ; // works even if obj is null or of a different type
364
378
}
365
379
366
380
/// <summary>
367
- /// Gets the hash code.
381
+ /// Returns the hash code for this MongoGridFSFileInfo object .
368
382
/// </summary>
369
- /// <returns>The hash code.</returns>
383
+ /// <returns>A 32-bit signed integer hash code.</returns>
370
384
public override int GetHashCode ( )
371
385
{
372
386
// see Effective Java by Joshua Bloch
0 commit comments