> ## Documentation Index
> Fetch the complete documentation index at: https://easyaf.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# IndexedDbIndex

> Defines an Index for a given object store.

## Definition

**Assembly:** CloudNimble.BlazorEssentials.IndexedDb.dll

**Namespace:** CloudNimble.BlazorEssentials.IndexedDb

**Inheritance:** System.Object

## Syntax

```csharp theme={"dark"}
CloudNimble.BlazorEssentials.IndexedDb.IndexedDbIndex
```

## Summary

Defines an Index for a given object store.

## Constructors

### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> .ctor

#### Syntax

```csharp theme={"dark"}
public IndexedDbIndex(CloudNimble.BlazorEssentials.IndexedDb.IndexedDbObjectStore objectStore, string name, string keyPath, bool multiEntry = false, bool unique = false)
```

#### Parameters

| Name          | Type                                                          | Description |
| ------------- | ------------------------------------------------------------- | ----------- |
| `objectStore` | `CloudNimble.BlazorEssentials.IndexedDb.IndexedDbObjectStore` | -           |
| `name`        | `string`                                                      | -           |
| `keyPath`     | `string`                                                      | -           |
| `multiEntry`  | `bool`                                                        | -           |
| `unique`      | `bool`                                                        | -           |

#### Exceptions

| Exception            | Description |
| -------------------- | ----------- |
| `IndexedDbException` |             |

### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> .ctor <Badge color="gray">Inherited</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public Object()
```

## Properties

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> Database

#### Syntax

```csharp theme={"dark"}
public CloudNimble.BlazorEssentials.IndexedDb.IndexedDbDatabase Database { get; init; }
```

#### Property Value

Type: `CloudNimble.BlazorEssentials.IndexedDb.IndexedDbDatabase`

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> KeyPath

the identifier for the property in the object/record that is saved and is to be indexed.
can be multiple properties separated by comma
if null will default to index name

#### Syntax

```csharp theme={"dark"}
public string KeyPath { get; }
```

#### Property Value

Type: `string`

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> MultiEntry

Affects how the index behaves when the result of evaluating the index's key path yields an array.
If true, there is one record in the index for each item in an array of keys.
If false, then there is one record for each key that is an array.

#### Syntax

```csharp theme={"dark"}
public bool MultiEntry { get; }
```

#### Property Value

Type: `bool`

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> Name

The name of the index.

#### Syntax

```csharp theme={"dark"}
public string Name { get; }
```

#### Property Value

Type: `string`

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> ObjectStore

Only use for indexes
If true, this index does not allow duplicate values for a key.

#### Syntax

```csharp theme={"dark"}
public CloudNimble.BlazorEssentials.IndexedDb.IndexedDbObjectStore ObjectStore { get; init; }
```

#### Property Value

Type: `CloudNimble.BlazorEssentials.IndexedDb.IndexedDbObjectStore`

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> Unique

Only use for indexes
If true, this index does not allow duplicate values for a key.

#### Syntax

```csharp theme={"dark"}
public bool Unique { get; }
```

#### Property Value

Type: `bool`

## Methods

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> CountAsync

Count records in Index

#### Syntax

```csharp theme={"dark"}
public System.Threading.Tasks.Task<int> CountAsync()
```

#### Returns

Type: `System.Threading.Tasks.Task<int>`

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> CountAsync

Count records in Index

#### Syntax

```csharp theme={"dark"}
public System.Threading.Tasks.Task<int> CountAsync<TKey>(TKey key)
```

#### Parameters

| Name  | Type   | Description |
| ----- | ------ | ----------- |
| `key` | `TKey` | -           |

#### Returns

Type: `System.Threading.Tasks.Task<int>`

#### Type Parameters

* `TKey` -

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> CountAsync

Count records in Index

#### Syntax

```csharp theme={"dark"}
public System.Threading.Tasks.Task<int> CountAsync<TKey>(CloudNimble.BlazorEssentials.IndexedDb.KeyRange<TKey> key)
```

#### Parameters

| Name  | Type                                                    | Description |
| ----- | ------------------------------------------------------- | ----------- |
| `key` | `CloudNimble.BlazorEssentials.IndexedDb.KeyRange<TKey>` | -           |

#### Returns

Type: `System.Threading.Tasks.Task<int>`

#### Type Parameters

* `TKey` -

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> Equals <Badge color="gray">Inherited</Badge> <Badge color="orange">Virtual</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public virtual bool Equals(object obj)
```

#### Parameters

| Name  | Type      | Description |
| ----- | --------- | ----------- |
| `obj` | `object?` | -           |

#### Returns

Type: `bool`

### <Icon icon="thumbtack" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> Equals <Badge color="gray">Inherited</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public static bool Equals(object objA, object objB)
```

#### Parameters

| Name   | Type      | Description |
| ------ | --------- | ----------- |
| `objA` | `object?` | -           |
| `objB` | `object?` | -           |

#### Returns

Type: `bool`

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> GetAllAsync

Gets all of the records that match a given query in the specified index.

#### Syntax

```csharp theme={"dark"}
public System.Threading.Tasks.Task<System.Collections.Generic.List<TResult>> GetAllAsync<TResult>(System.Nullable<int> count = null)
```

#### Parameters

| Name    | Type                   | Description |
| ------- | ---------------------- | ----------- |
| `count` | `System.Nullable<int>` | -           |

#### Returns

Type: `System.Threading.Tasks.Task<System.Collections.Generic.List<TResult>>`

#### Type Parameters

* `TResult` -

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> GetAllAsync

Gets all of the records that match a given query in the specified index.

#### Syntax

```csharp theme={"dark"}
public System.Threading.Tasks.Task<System.Collections.Generic.List<TResult>> GetAllAsync<TKey, TResult>(TKey key, System.Nullable<int> count = null)
```

#### Parameters

| Name    | Type                   | Description |
| ------- | ---------------------- | ----------- |
| `key`   | `TKey`                 | -           |
| `count` | `System.Nullable<int>` | -           |

#### Returns

Type: `System.Threading.Tasks.Task<System.Collections.Generic.List<TResult>>`

#### Type Parameters

* `TKey` -
* `TResult` -

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> GetAllAsync

Gets all of the records that match a given query in the specified index.

#### Syntax

```csharp theme={"dark"}
public System.Threading.Tasks.Task<System.Collections.Generic.List<TResult>> GetAllAsync<TKey, TResult>(CloudNimble.BlazorEssentials.IndexedDb.KeyRange<TKey> key, System.Nullable<int> count = null)
```

#### Parameters

| Name    | Type                                                    | Description |
| ------- | ------------------------------------------------------- | ----------- |
| `key`   | `CloudNimble.BlazorEssentials.IndexedDb.KeyRange<TKey>` | -           |
| `count` | `System.Nullable<int>`                                  | -           |

#### Returns

Type: `System.Threading.Tasks.Task<System.Collections.Generic.List<TResult>>`

#### Type Parameters

* `TKey` -
* `TResult` -

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> GetAllAsync

Gets all of the records that match a given query in the specified index.

#### Syntax

```csharp theme={"dark"}
public System.Threading.Tasks.Task<System.Collections.Generic.List<TResult>> GetAllAsync<TKey, TResult>(TKey[] key)
```

#### Parameters

| Name  | Type     | Description |
| ----- | -------- | ----------- |
| `key` | `TKey[]` | -           |

#### Returns

Type: `System.Threading.Tasks.Task<System.Collections.Generic.List<TResult>>`

#### Type Parameters

* `TKey` -
* `TResult` -

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> GetAllKeysAsync

Gets all of the records keys that match a given query in the specified index.

#### Syntax

```csharp theme={"dark"}
public System.Threading.Tasks.Task<System.Collections.Generic.List<TResult>> GetAllKeysAsync<TResult>(System.Nullable<int> count = null)
```

#### Parameters

| Name    | Type                   | Description |
| ------- | ---------------------- | ----------- |
| `count` | `System.Nullable<int>` | -           |

#### Returns

Type: `System.Threading.Tasks.Task<System.Collections.Generic.List<TResult>>`

#### Type Parameters

* `TResult` -

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> GetAllKeysAsync

Gets all of the records keys that match a given query in the specified index.

#### Syntax

```csharp theme={"dark"}
public System.Threading.Tasks.Task<System.Collections.Generic.List<TResult>> GetAllKeysAsync<TKey, TResult>(TKey key, System.Nullable<int> count = null)
```

#### Parameters

| Name    | Type                   | Description |
| ------- | ---------------------- | ----------- |
| `key`   | `TKey`                 | -           |
| `count` | `System.Nullable<int>` | -           |

#### Returns

Type: `System.Threading.Tasks.Task<System.Collections.Generic.List<TResult>>`

#### Type Parameters

* `TKey` -
* `TResult` -

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> GetAllKeysAsync

Gets all of the records that match a given query in the specified index.

#### Syntax

```csharp theme={"dark"}
public System.Threading.Tasks.Task<System.Collections.Generic.List<TResult>> GetAllKeysAsync<TKey, TResult>(CloudNimble.BlazorEssentials.IndexedDb.KeyRange<TKey> key, System.Nullable<int> count = null)
```

#### Parameters

| Name    | Type                                                    | Description |
| ------- | ------------------------------------------------------- | ----------- |
| `key`   | `CloudNimble.BlazorEssentials.IndexedDb.KeyRange<TKey>` | -           |
| `count` | `System.Nullable<int>`                                  | -           |

#### Returns

Type: `System.Threading.Tasks.Task<System.Collections.Generic.List<TResult>>`

#### Type Parameters

* `TKey` -
* `TResult` -

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> GetAllKeysAsync

Gets all of the records that match a given query in the specified index.

#### Syntax

```csharp theme={"dark"}
public System.Threading.Tasks.Task<System.Collections.Generic.List<TResult>> GetAllKeysAsync<TKey, TResult>(TKey[] key)
```

#### Parameters

| Name  | Type     | Description |
| ----- | -------- | ----------- |
| `key` | `TKey[]` | -           |

#### Returns

Type: `System.Threading.Tasks.Task<System.Collections.Generic.List<TResult>>`

#### Type Parameters

* `TKey` -
* `TResult` -

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> GetAsync

Returns the first record that matches a query against a given index

#### Syntax

```csharp theme={"dark"}
public System.Threading.Tasks.Task<TResult> GetAsync<TKey, TResult>(TKey queryValue)
```

#### Parameters

| Name         | Type   | Description |
| ------------ | ------ | ----------- |
| `queryValue` | `TKey` | -           |

#### Returns

Type: `System.Threading.Tasks.Task<TResult>`

#### Type Parameters

* `TKey` -
* `TResult` -

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> GetHashCode <Badge color="gray">Inherited</Badge> <Badge color="orange">Virtual</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public virtual int GetHashCode()
```

#### Returns

Type: `int`

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> GetKeyAsync

Returns the first record keys that matches a query against a given index

#### Syntax

```csharp theme={"dark"}
public System.Threading.Tasks.Task<TResult> GetKeyAsync<TKey, TResult>(TKey key)
```

#### Parameters

| Name  | Type   | Description |
| ----- | ------ | ----------- |
| `key` | `TKey` | -           |

#### Returns

Type: `System.Threading.Tasks.Task<TResult>`

#### Type Parameters

* `TKey` -
* `TResult` -

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> GetType <Badge color="gray">Inherited</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public System.Type GetType()
```

#### Returns

Type: `System.Type`

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> MemberwiseClone <Badge color="gray">Inherited</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
protected internal object MemberwiseClone()
```

#### Returns

Type: `object`

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> QueryAsync

Gets all of the records using a filter expression

#### Syntax

```csharp theme={"dark"}
public System.Threading.Tasks.Task<System.Collections.Generic.List<TResult>> QueryAsync<TResult>(string filter, System.Nullable<int> count = null, System.Nullable<int> skip = null)
```

#### Parameters

| Name     | Type                   | Description                                                                       |
| -------- | ---------------------- | --------------------------------------------------------------------------------- |
| `filter` | `string`               | expression that evaluates to true/false, each record es passed to "obj" parameter |
| `count`  | `System.Nullable<int>` | -                                                                                 |
| `skip`   | `System.Nullable<int>` | -                                                                                 |

#### Returns

Type: `System.Threading.Tasks.Task<System.Collections.Generic.List<TResult>>`

#### Type Parameters

* `TResult` -

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> QueryAsync

Gets all of the records using a filter expression

#### Syntax

```csharp theme={"dark"}
public System.Threading.Tasks.Task<System.Collections.Generic.List<TResult>> QueryAsync<TKey, TResult>(string filter, TKey key, System.Nullable<int> count = null, System.Nullable<int> skip = null)
```

#### Parameters

| Name     | Type                   | Description                                                                       |
| -------- | ---------------------- | --------------------------------------------------------------------------------- |
| `filter` | `string`               | expression that evaluates to true/false, each record es passed to "obj" parameter |
| `key`    | `TKey`                 | -                                                                                 |
| `count`  | `System.Nullable<int>` | -                                                                                 |
| `skip`   | `System.Nullable<int>` | -                                                                                 |

#### Returns

Type: `System.Threading.Tasks.Task<System.Collections.Generic.List<TResult>>`

#### Type Parameters

* `TKey` -
* `TResult` -

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> QueryAsync

Gets all of the records using a filter expression

#### Syntax

```csharp theme={"dark"}
public System.Threading.Tasks.Task<System.Collections.Generic.List<TResult>> QueryAsync<TKey, TResult>(string filter, CloudNimble.BlazorEssentials.IndexedDb.KeyRange<TKey> key, System.Nullable<int> count = null, System.Nullable<int> skip = null)
```

#### Parameters

| Name     | Type                                                    | Description                                                                       |
| -------- | ------------------------------------------------------- | --------------------------------------------------------------------------------- |
| `filter` | `string`                                                | expression that evaluates to true/false, each record es passed to "obj" parameter |
| `key`    | `CloudNimble.BlazorEssentials.IndexedDb.KeyRange<TKey>` | -                                                                                 |
| `count`  | `System.Nullable<int>`                                  | -                                                                                 |
| `skip`   | `System.Nullable<int>`                                  | -                                                                                 |

#### Returns

Type: `System.Threading.Tasks.Task<System.Collections.Generic.List<TResult>>`

#### Type Parameters

* `TKey` -
* `TResult` -

### <Icon icon="thumbtack" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> ReferenceEquals <Badge color="gray">Inherited</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public static bool ReferenceEquals(object objA, object objB)
```

#### Parameters

| Name   | Type      | Description |
| ------ | --------- | ----------- |
| `objA` | `object?` | -           |
| `objB` | `object?` | -           |

#### Returns

Type: `bool`

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> ToString <Badge color="gray">Inherited</Badge> <Badge color="orange">Virtual</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public virtual string ToString()
```

#### Returns

Type: `string?`
