> ## 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.

# IndexedDbObjectStore

> Defines a store to add to database

## Definition

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

**Namespace:** CloudNimble.BlazorEssentials.IndexedDb

**Inheritance:** System.Object

## Syntax

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

## Summary

Defines a store to add to database

## Constructors

### &#x20;.ctor

Add new ObjectStore definition

#### Syntax

```csharp theme={"dark"}
public IndexedDbObjectStore(CloudNimble.BlazorEssentials.IndexedDb.IndexedDbDatabase database, CloudNimble.BlazorEssentials.IndexedDb.ObjectStoreAttribute attribute = null)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `database` | `CloudNimble.BlazorEssentials.IndexedDb.IndexedDbDatabase` | - |
| `attribute` | `CloudNimble.BlazorEssentials.IndexedDb.ObjectStoreAttribute` | - |

### &#x20;.ctor

Add new ObjectStore definition

#### Syntax

```csharp theme={"dark"}
public IndexedDbObjectStore(CloudNimble.BlazorEssentials.IndexedDb.IndexedDbDatabase database, string name, string keyPath = "id", bool autoIncrement = false)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `database` | `CloudNimble.BlazorEssentials.IndexedDb.IndexedDbDatabase` | - |
| `name` | `string` | - |
| `keyPath` | `string` | - |
| `autoIncrement` | `bool` | - |

### &#x20;.ctor Inherited

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

#### Syntax

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

## Properties

### &#x20;AutoIncrement

If true, the object store has a key generator. Defaults to false.
Note that every object store has its own separate auto increment counter.

#### Syntax

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

#### Property Value

Type: `bool`

### &#x20;Database

IDMManager

#### Syntax

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

#### Property Value

Type: `CloudNimble.BlazorEssentials.IndexedDb.IndexedDbDatabase`

### &#x20;Indexes

Provides a set of additional indexes if required.

#### Syntax

```csharp theme={"dark"}
public System.Collections.Generic.List<CloudNimble.BlazorEssentials.IndexedDb.IndexedDbIndex> Indexes { get; init; }
```

#### Property Value

Type: `System.Collections.Generic.List<CloudNimble.BlazorEssentials.IndexedDb.IndexedDbIndex>`

### &#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 this property is null, the application must provide a key for each modification operation.

#### Syntax

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

#### Property Value

Type: `string?`

### &#x20;Name

The name for the store

#### Syntax

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

#### Property Value

Type: `string`

## Methods

### &#x20;AddAsync

Adds a new record/object to the specified ObjectStore

#### Syntax

```csharp theme={"dark"}
public System.Threading.Tasks.Task AddAsync<TData>(TData data) where TData : notnull
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `data` | `TData` | - |

#### Returns

Type: `System.Threading.Tasks.Task`

#### Type Parameters

* `TData` -

### &#x20;AddAsync

Adds a new record/object to the specified ObjectStore

#### Syntax

```csharp theme={"dark"}
public System.Threading.Tasks.Task<TKey> AddAsync<TData, TKey>(TData data)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `data` | `TData` | - |

#### Returns

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

#### Type Parameters

* `TData` -
* `TKey` -

### &#x20;AddAsync

Adds a new record/object to the specified ObjectStore

#### Syntax

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

#### Parameters

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

#### Returns

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

#### Type Parameters

* `TData` -
* `TKey` -

### &#x20;BatchAddAsync

Add an array of new record/object in one transaction to the specified store

#### Syntax

```csharp theme={"dark"}
public System.Threading.Tasks.Task BatchAddAsync<TData>(TData[] data)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `data` | `TData[]` | - |

#### Returns

Type: `System.Threading.Tasks.Task`

#### Type Parameters

* `TData` -

### &#x20;BatchAddAsync

Add an array of new record/object in one transaction to the specified store

#### Syntax

```csharp theme={"dark"}
public System.Threading.Tasks.Task<TKey[]> BatchAddAsync<TData, TKey>(TData[] data)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `data` | `TData[]` | - |

#### Returns

Type: `System.Threading.Tasks.Task<TKey[]>`

#### Type Parameters

* `TData` -
* `TKey` -

### &#x20;BatchDeleteAsync

Delete multiple records from the store based on the id

#### Syntax

```csharp theme={"dark"}
public System.Threading.Tasks.Task BatchDeleteAsync<TKey>(TKey[] ids)
```

#### Parameters

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

#### Returns

Type: `System.Threading.Tasks.Task`

#### Type Parameters

* `TKey` -

### &#x20;BatchPutAsync

Put an array of new record/object in one transaction to the specified store

#### Syntax

```csharp theme={"dark"}
public System.Threading.Tasks.Task BatchPutAsync<TData>(TData[] data)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `data` | `TData[]` | - |

#### Returns

Type: `System.Threading.Tasks.Task`

#### Type Parameters

* `TData` -

### &#x20;BatchPutAsync

Put an array of new record/object in one transaction to the specified store

#### Syntax

```csharp theme={"dark"}
public System.Threading.Tasks.Task<TKey[]> BatchPutAsync<TData, TKey>(TData[] data)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `data` | `TData[]` | - |

#### Returns

Type: `System.Threading.Tasks.Task<TKey[]>`

#### Type Parameters

* `TData` -
* `TKey` -

### &#x20;ClearStoreAsync

Clears all of the records from a given store.

#### Syntax

```csharp theme={"dark"}
public System.Threading.Tasks.Task ClearStoreAsync()
```

#### Returns

Type: `System.Threading.Tasks.Task`

### &#x20;CountAsync

Count records in ObjectStore

#### Syntax

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

#### Returns

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

### &#x20;CountAsync

Count records in ObjectStore

#### 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 ObjectStore

#### 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;DeleteAsync

Deletes a record from the store based on the id

#### Syntax

```csharp theme={"dark"}
public System.Threading.Tasks.Task DeleteAsync<TKey>(TKey key) where TKey : notnull
```

#### Parameters

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

#### Returns

Type: `System.Threading.Tasks.Task`

#### 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 in a given store.

#### 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 by Key in a given store.

#### 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 by KeyRange in a given store.

#### 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 by ArrayKey in a given store.

#### 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 in a given store.

#### 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 by Key in a given store.

#### 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 by KeyRange in a given store.

#### 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 by ArrayKey in a given store.

#### 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

Retrieve a record by Key

#### Syntax

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

#### Parameters

| Name | Type | Description |
| - | - | - |
| `key` | `TKey` | the key of the record |

#### 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

Retrieve a record key by Key

#### Syntax

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

#### Parameters

| Name | Type | Description |
| - | - | - |
| `key` | `TKey` | the key of the record |

#### 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;PutAsync

Updates and existing record

#### Syntax

```csharp theme={"dark"}
public System.Threading.Tasks.Task PutAsync<TData>(TData data) where TData : notnull
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `data` | `TData` | - |

#### Returns

Type: `System.Threading.Tasks.Task`

#### Type Parameters

* `TData` -

### &#x20;PutAsync

Updates and existing record

#### Syntax

```csharp theme={"dark"}
public System.Threading.Tasks.Task<TKey> PutAsync<TData, TKey>(TData data)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `data` | `TData` | - |

#### Returns

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

#### Type Parameters

* `TData` -
* `TKey` -

### &#x20;PutAsync

Updates and existing record

#### Syntax

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

#### Parameters

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

#### Returns

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

#### Type Parameters

* `TData` -
* `TKey` -

### &#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 name, string filter, TKey key, System.Nullable<int> count = null, System.Nullable<int> skip = null)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `name` | `string` | - |
| `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.