Click or drag to resize

CompareByFieldKey Class

Use this predefined comparator whenever the sorting can be defined by specifying one or more fields of the sorted Key type.
Inheritance Hierarchy
SystemObject
  VelocityDbOptimizedPersistable
    VelocityDb.Collection.ComparerVelocityDbComparerKey
      VelocityDb.Collection.ComparerCompareByFieldKey
        VelocityDb.Collection.ComparerCompareByFieldIndexKey

Namespace:  VelocityDb.Collection.Comparer
Assembly:  VelocityDb (in VelocityDb.dll) Version: 11.1.0.0 (11.1)
Syntax
[SerializableAttribute]
public class CompareByField<Key> : VelocityDbComparer<Key>

Type Parameters

Key
The type of object being compared (containing field(s) to compare)

The CompareByFieldKey type exposes the following members.

Constructors
Properties
Methods
  NameDescription
Public methodAddFieldToCompare
Add an additional field to compare when prior fields all are equal
Public methodCompare(Key, Key)
Compares field(s) of Key a with field(s) of Key b
(Overrides VelocityDbComparerKeyCompare(Key, Key).)
Public methodCompare(Byte, Int32, Byte, Key) (Overrides VelocityDbComparerKeyCompare(Byte, Int32, Byte, Key).)
Public methodCompareField
For internal use. Compares a field value in two objects
Public methodStatic memberGetHashCode32
Microsoft messed up the 64 bit version of GetHashCode. Use this original 32-bit version to get consistent String hash codes across 32 bit and 64 bit builds. See remarks in https://msdn.microsoft.com/en-us/library/system.string.gethashcode(v=vs.110).aspx
Public methodInitializeAfterRecreate
This function is called when an object has been read from disk before all data members (fields) have been fully loaded. Override this to provide your own initializations of transient data.
(Overrides OptimizedPersistableInitializeAfterRecreate(SessionBase).)
Public methodSetComparisonArrayFromObject
Sets a byte array equivalent to the field values to compare. Using this bypasses object compares, instead the byte arrays are compared byte by byte until a diff is found. If a byte diff isn't found then object compares may happen. Field types currently supported: byte, bool, Char, string, Int16, Int32, Int64, UInt16, UInt32, UInt64, Single, Double, DateTime, TimeSpan
(Overrides VelocityDbComparerKeySetComparisonArrayFromObject(Key, Byte, Boolean).)
Public methodSetupFieldsToCompare
Initializes data used to compare fields as specified with this comparer.
Top
Extension Methods
  NameDescription
Public Extension MethodToStringDetails(SessionBase, Boolean)Overloaded.
Object details as a string
(Defined by Utilities.)
Public Extension MethodToStringDetails(Schema, TypeVersion, Boolean)Overloaded.
Currently only used by Database Manager
(Defined by Utilities.)
Top
See Also