Gets a value that indicates whether the key used in this index is a unique key for the collection.
Namespace:
C1.LiveLinq.IndexingAssembly: C1.LiveLinq (in C1.LiveLinq.dll)
Syntax
C# |
---|
public bool KeyIsUnique { get; private set; } |
Visual Basic |
---|
Public Property KeyIsUnique As Boolean Get Private Set |
Field Value
true if the key is unique; otherwise, falseRemarks
A unique index occupies less memory and performs better than a non-unique index (although the difference isn't dramatic). Therefore, for unique keys, it's recommended to specify the corresponding index as unique in the IndexCollection.Add method.
But do that only if you are sure that the key is indeed unique, as it imposes a uniqueness constraint on the collection. An attempt to modify the collection violating the uniqueness throws an InvalidOperationException.