> ## Documentation Index
> Fetch the complete documentation index at: https://easyaf.nimbleapps.cloud/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

### &#x20;.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` | |

### &#x20;.ctor Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

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

## Properties

### &#x20;Database

#### Syntax

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

#### Property Value

Type: `CloudNimble.BlazorEssentials.IndexedDb.IndexedDbDatabase`

### &#x20;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`

### &#x20;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`

### &#x20;Name

The name of the index.

#### Syntax

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

#### Property Value

Type: `string`

### &#x20;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`

### &#x20;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

### &#x20;CountAsync

Count records in Index

#### Syntax

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

#### Returns

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

### &#x20;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` -

### &#x20;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` -

### &#x20;Equals Inherited Virtual

> [!NOTE]
>
> Inherited from `object`

#### Syntax

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

#### Parameters

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

#### Returns

Type: `bool`

### &#x20;Equals Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

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

#### Parameters

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

#### Returns

Type: `bool`

### &#x20;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` -

### &#x20;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` -

### &#x20;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` -

### &#x20;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` -

### &#x20;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` -

### &#x20;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` -

### &#x20;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` -

### &#x20;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` -

### &#x20;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` -

### &#x20;GetHashCode Inherited Virtual

> [!NOTE]
>
> Inherited from `object`

#### Syntax

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

#### Returns

Type: `int`

### &#x20;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` -

### &#x20;GetType Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

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

#### Returns

Type: `System.Type`

### &#x20;MemberwiseClone Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

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

#### Returns

Type: `object`

### &#x20;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` -

### &#x20;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` -

### &#x20;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` -

### &#x20;ReferenceEquals Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

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

#### Parameters

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

#### Returns

Type: `bool`

### &#x20;ToString Inherited Virtual

> [!NOTE]
>
> Inherited from `object`

#### Syntax

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

#### Returns

Type: `string?`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.