%%PageItemTitle%% $$Members$$

Compare .NET Objects

Compare .NET Objects
ComparisonConfig Class Members
See Also  Properties  Methods  Send Feedback
KellermanSoftware.CompareNetObjects Namespace : ComparisonConfig Class

Glossary Item Box

The following tables list the members exposed by ComparisonConfig.

Public Constructors

 NameDescription
Public ConstructorComparisonConfig Constructor Default Constructor  
Top

Public Properties

 NameDescription
Public PropertyActualName In the differences string, this is the name for the actual name. The default is: Actual  
Public PropertyAttributesToIgnore A list of attributes to ignore a class, property or field  
Public PropertyAutoClearCache Reflection properties and fields are cached. By default this cache is cleared after each compare. Set to false to keep the cache for multiple compares.  
Public PropertyCaching By default properties and fields for types are cached for each compare. By default this cache is cleared after each compare.  
Public PropertyCaseSensitive When comparing strings or StringBuilder types, perform a case sensitive comparison. The default is true.  
Public PropertyClassTypesToIgnore A list of class types to be ignored in the comparison. The default is to compare all class types.  
Public PropertyClassTypesToInclude Only these class types will be compared. The default is to compare all class types.  
Public PropertyCollectionMatchingSpec Sometimes one wants to match items between collections by some key first, and then compare the matched objects. Without this, the comparer basically says there is no match in collection B for any given item in collection A that doesn't Compare with a result of true. The results of this aren't particularly useful for object graphs that are mostly the same, but not quite. Enter CollectionMatchingSpec The enumerable strings should be property (not field, for now, to keep it simple) names of the Type when encountered that will be used for matching You can use complex type properties, too, as part of the key to match. To match on all props/fields on such a matching key, Don't set this property (default comparer behavior) NOTE: types are looked up as exact. e.g. if foo is an entry in the dictionary and bar is a sub-class of foo, upon encountering a bar type, the comparer will not find the entry of foo  
Public PropertyCompareChildren If true, child objects will be compared. The default is true. If false, and a list or array is compared list items will be compared but not their children.  
Public PropertyCompareDateTimeOffsetWithOffsets When comparing DateTimeOffsets, offsets will be compared as well as the UtcDateTimes. The default is false.  
Public PropertyCompareFields If true, compare fields of a class (see also CompareProperties). The default is true.  
Public PropertyComparePrivateFields If true, private fields will be compared. The default is false. Silverlight and WinRT restricts access to private variables.  
Public PropertyComparePrivateProperties If true, private properties and fields will be compared. The default is false. Silverlight and WinRT restricts access to private variables.  
Public PropertyCompareProperties If true, compare properties of a class (see also CompareFields). The default is true.  
Public PropertyCompareReadOnly If true, compare read only properties (only the getter is implemented). The default is true.  
Public PropertyCompareStaticFields If true, static fields will be compared. The default is true.  
Public PropertyCompareStaticProperties If true, static properties will be compared. The default is true.  
Public PropertyCustomComparers A list of custom comparers that take priority over the built in comparers  
Public PropertyDecimalPrecision The precision to compare decimal values. The default is 0.  
Public PropertyDifferenceCallback Callback invoked each time the comparer finds a difference. The default is no call back.  
Public PropertyDoublePrecision The precision to compare double values. The default is 0.  
Public PropertyExpectedName In the differences string, this is the name for expected name. The default is: Expected  
Public PropertyIgnoreCollectionOrder If true, compare each item within a collection to every item in the other. The default is false. WARNING: setting this to true significantly impacts performance.  
Public PropertyIgnoreObjectDisposedException Ignore exceptions when objects are disposed  
Public PropertyIgnoreObjectTypes If true, objects will be compared ignore their type diferences. The default is false.  
Public PropertyIgnoreUnknownObjectTypes If true, unknown object types will be ignored instead of throwing an exception. The default is false.  
Public PropertyInterfaceMembers If a class implements an interface then only members of the interface will be compared. The default is all members are compared.  
Public PropertyMaxByteArrayDifferences The maximum number of differences to detect when comparing byte arrays. The default is 1.  
Public PropertyMaxDifferences The maximum number of differences to detect. The default is 1 for performance reasons.  
Public PropertyMaxMillisecondsDateDifference Ignore millisecond differences between DateTime values or DateTimeOffset values. The default is 0 (any time difference will be shown).  
Public PropertyMaxStructDepth When comparing struct, the depth to compare for children. The default is 2, the max is 5  
Public PropertyMembersToIgnore Ignore Data Table Names, Data Table Column Names, properties, or fields by name during the comparison. Case sensitive. The default is to compare all members.  
Public PropertyMembersToInclude Only compare elements by name for Data Table Names, Data Table Column Names, properties and fields. Case sensitive. The default is to compare all members.  
Public PropertyShowBreadcrumb Show breadcrumb at each stage of the comparision. The default is false. This is useful for debugging deep object graphs.  
Public PropertySkipInvalidIndexers If true, invalid indexers will be skipped. The default is false.  
Public PropertyTreatStringEmptyAndNullTheSame If true, string.empty and null will be treated as equal for Strings and String Builder. The default is false.  
Public PropertyTypesToIgnore A list of types to be ignored in the comparison. The default is to compare all types. A typical thing to not compare are GUIDs  
Public PropertyTypesToInclude Only these types will be compared. The default is to compare all types.  
Top

Public Methods

 NameDescription
Public MethodReset Reset the configuration to the default values  
Top

See Also

© Kellerman Software 2018 All Rights Reserved.