[]
Creates a new index and adds it to the collection of indexes.
public IIndexScanner<T, TKey> Add<TKey>(Expression<Func<T, TKey>> keySelector, bool keyIsUnique, bool onlyOnce, IndexingAlgorithm algorithm, CultureInfo locale)
Type | Name | Description |
---|---|---|
Expression<Func<T, TKey>> | keySelector | Key selector expression of the index, see KeySelector. |
bool | keyIsUnique | Specifies whether the key used in this index is a unique key for the indexed collection (default: false). |
bool | onlyOnce | Specifies whether it is required that the index does not exist prior to this method call (default: false). If an index with this keySelector already exists, an exception is thrown if it is true, and this method call is ignored if it is false. |
IndexingAlgorithm | algorithm | An IndexingAlgorithm used by the index. In the current version, only one algorithm is supported, RedBlackTree. Later versions may support other algorithms, such as bitmap or hash indexes. |
CultureInfo | locale | Locale information used to compare strings in the index (default: CultureInfo.CurrentCulture). |
Type | Description |
---|---|
IIndexScanner<T, TKey> | The new index added to the collection of indexes. |
Name | Description |
---|---|
TKey | The type of the index key. |
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.
But do that only if you are sure that the key is indeed unique, as it imposes a uniqueness constraint on the indexed collection. An attempt to modify the indexed collection violating the uniqueness throws an InvalidOperationException.
Creates a new index and adds it to the collection of indexes.
public IIndexScanner<T, TKey> Add<TKey>(Expression<Func<T, TKey>> keySelector, bool keyIsUnique, bool onlyOnce, CultureInfo locale)
Type | Name | Description |
---|---|---|
Expression<Func<T, TKey>> | keySelector | Key selector expression of the index, see KeySelector. |
bool | keyIsUnique | Specifies whether the key used in this index is a unique key for the indexed collection (default: false). |
bool | onlyOnce | Specifies whether it is required that the index does not exist prior to this method call (default: false). If an index with this keySelector already exists, an exception is thrown if it is true, and this method call is ignored if it is false. |
CultureInfo | locale | Locale information used to compare strings in the index (default: CultureInfo.CurrentCulture). |
Type | Description |
---|---|
IIndexScanner<T, TKey> | The new index added to the collection of indexes. |
Name | Description |
---|---|
TKey | The type of the index key. |
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.
But do that only if you are sure that the key is indeed unique, as it imposes a uniqueness constraint on the indexed collection. An attempt to modify the indexed collection violating the uniqueness throws an InvalidOperationException.
Creates a new index and adds it to the collection of indexes.
public IIndexScanner<T, TKey> Add<TKey>(Expression<Func<T, TKey>> keySelector, bool keyIsUnique, bool onlyOnce)
Type | Name | Description |
---|---|---|
Expression<Func<T, TKey>> | keySelector | Key selector expression of the index, see KeySelector. |
bool | keyIsUnique | Specifies whether the key used in this index is a unique key for the indexed collection (default: false). |
bool | onlyOnce | Specifies whether it is required that the index does not exist prior to this method call (default: false). If an index with this keySelector already exists, an exception is thrown if it is true, and this method call is ignored if it is false. |
Type | Description |
---|---|
IIndexScanner<T, TKey> | The new index added to the collection of indexes. |
Name | Description |
---|---|
TKey | The type of the index key. |
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.
But do that only if you are sure that the key is indeed unique, as it imposes a uniqueness constraint on the indexed collection. An attempt to modify the indexed collection violating the uniqueness throws an InvalidOperationException.
Creates a new index and adds it to the collection of indexes.
public IIndexScanner<T, TKey> Add<TKey>(Expression<Func<T, TKey>> keySelector, bool keyIsUnique)
Type | Name | Description |
---|---|---|
Expression<Func<T, TKey>> | keySelector | Key selector expression of the index, see KeySelector. |
bool | keyIsUnique | Specifies whether the key used in this index is a unique key for the indexed collection (default: false). |
Type | Description |
---|---|
IIndexScanner<T, TKey> | The new index added to the collection of indexes. |
Name | Description |
---|---|
TKey | The type of the index key. |
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.
But do that only if you are sure that the key is indeed unique, as it imposes a uniqueness constraint on the indexed collection. An attempt to modify the indexed collection violating the uniqueness throws an InvalidOperationException.
Creates a new index and adds it to the collection of indexes.
public IIndexScanner<T, TKey> Add<TKey>(Expression<Func<T, TKey>> keySelector)
Type | Name | Description |
---|---|---|
Expression<Func<T, TKey>> | keySelector | Key selector expression of the index, see KeySelector. |
Type | Description |
---|---|
IIndexScanner<T, TKey> | The new index added to the collection of indexes. |
Name | Description |
---|---|
TKey | The type of the index key. |
Creates a new index and adds it to the collection of indexes.
public IIndexScanner<T> Add(LambdaExpression keySelector, bool keyIsUnique, bool onlyOnce, IndexingAlgorithm algorithm, CultureInfo locale)
Type | Name | Description |
---|---|---|
LambdaExpression | keySelector | Key selector expression of the index, see KeySelector. |
bool | keyIsUnique | Specifies whether the key used in this index is a unique key for the indexed collection (default: false). |
bool | onlyOnce | Specifies whether it is required that the index does not exist prior to this method call. If an index with this keySelector already exists, an exception is thrown if it is true, and this method call is ignored if it is false. |
IndexingAlgorithm | algorithm | An IndexingAlgorithm used by the index. In the current version, only one algorithm is supported, RedBlackTree. Later versions may support other algorithms, such as bitmap or hash indexes. |
CultureInfo | locale | Locale information used to compare strings in the index (default: CultureInfo.CurrentCulture). |
Type | Description |
---|---|
IIndexScanner<T> | The new index added to the collection of indexes. |
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.
But do that only if you are sure that the key is indeed unique, as it imposes a uniqueness constraint on the indexed collection. An attempt to modify the indexed collection violating the uniqueness throws an InvalidOperationException.