Table of Contents

Interface IFactIdentityComparer

Namespace
NRules
Assembly
NRules.dll

Equality comparer used to compare fact identity, when inserting, updating, removing facts within the rules session.

public interface IFactIdentityComparer : IEqualityComparer<object>
Inherited Members

Remarks

The comparer uses the following rules to compare identity of the facts:

  • If both facts are the same reference, they are considered identical.
  • If facts are of different types, they are considered not identical.
  • If custom comparer is registered for the fact type in FactIdentityComparerRegistry, it is used to compare the identity of the facts.
  • In all other cases DefaultFactIdentityComparer is used to compare the identity of the facts. It checks if facts implement IIdentityProvider and compares the identity objects in this case. Otherwise, the facts are compared using their equality.

Methods

GetComparer<TFact>()

Retrieves a strongly typed fact identity comparer for a specific fact type.

IEqualityComparer<TFact> GetComparer<TFact>()

Returns

IEqualityComparer<TFact>

Strongly typed fact identity comparer.

Type Parameters

TFact

Type of fact to get an identity comparer for.