Skip to main content

Definition

Assembly: CloudNimble.BlazorEssentials.IndexedDb.dll Namespace: CloudNimble.BlazorEssentials.IndexedDb Inheritance: System.Object

Syntax

CloudNimble.BlazorEssentials.IndexedDb.IndexedDbObjectStore

Summary

Defines a store to add to database

Constructors

.ctor

Add new ObjectStore definition

Syntax

public IndexedDbObjectStore(CloudNimble.BlazorEssentials.IndexedDb.IndexedDbDatabase database, CloudNimble.BlazorEssentials.IndexedDb.ObjectStoreAttribute attribute = null)

Parameters

NameTypeDescription
databaseCloudNimble.BlazorEssentials.IndexedDb.IndexedDbDatabase-
attributeCloudNimble.BlazorEssentials.IndexedDb.ObjectStoreAttribute-

.ctor

Add new ObjectStore definition

Syntax

public IndexedDbObjectStore(CloudNimble.BlazorEssentials.IndexedDb.IndexedDbDatabase database, string name, string keyPath = "id", bool autoIncrement = false)

Parameters

NameTypeDescription
databaseCloudNimble.BlazorEssentials.IndexedDb.IndexedDbDatabase-
namestring-
keyPathstring-
autoIncrementbool-

.ctor Inherited

Inherited from object

Syntax

public Object()

Properties

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

public bool AutoIncrement { get; init; }

Property Value

Type: bool

Database

IDMManager

Syntax

public CloudNimble.BlazorEssentials.IndexedDb.IndexedDbDatabase Database { get; init; }

Property Value

Type: CloudNimble.BlazorEssentials.IndexedDb.IndexedDbDatabase

Indexes

Provides a set of additional indexes if required.

Syntax

public System.Collections.Generic.List<CloudNimble.BlazorEssentials.IndexedDb.IndexedDbIndex> Indexes { get; init; }

Property Value

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

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

public string KeyPath { get; init; }

Property Value

Type: string?

Name

The name for the store

Syntax

public string Name { get; internal set; }

Property Value

Type: string

Methods

AddAsync

Adds a new record/object to the specified ObjectStore

Syntax

public System.Threading.Tasks.Task AddAsync<TData>(TData data) where TData : notnull

Parameters

NameTypeDescription
dataTData-

Returns

Type: System.Threading.Tasks.Task

Type Parameters

  • TData -

AddAsync

Adds a new record/object to the specified ObjectStore

Syntax

public System.Threading.Tasks.Task<TKey> AddAsync<TData, TKey>(TData data)

Parameters

NameTypeDescription
dataTData-

Returns

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

Type Parameters

  • TData -
  • TKey -

AddAsync

Adds a new record/object to the specified ObjectStore

Syntax

public System.Threading.Tasks.Task<TKey> AddAsync<TData, TKey>(TData data, TKey key)

Parameters

NameTypeDescription
dataTData-
keyTKey-

Returns

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

Type Parameters

  • TData -
  • TKey -

BatchAddAsync

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

Syntax

public System.Threading.Tasks.Task BatchAddAsync<TData>(TData[] data)

Parameters

NameTypeDescription
dataTData[]-

Returns

Type: System.Threading.Tasks.Task

Type Parameters

  • TData -

BatchAddAsync

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

Syntax

public System.Threading.Tasks.Task<TKey[]> BatchAddAsync<TData, TKey>(TData[] data)

Parameters

NameTypeDescription
dataTData[]-

Returns

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

Type Parameters

  • TData -
  • TKey -

BatchDeleteAsync

Delete multiple records from the store based on the id

Syntax

public System.Threading.Tasks.Task BatchDeleteAsync<TKey>(TKey[] ids)

Parameters

NameTypeDescription
idsTKey[]-

Returns

Type: System.Threading.Tasks.Task

Type Parameters

  • TKey -

BatchPutAsync

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

Syntax

public System.Threading.Tasks.Task BatchPutAsync<TData>(TData[] data)

Parameters

NameTypeDescription
dataTData[]-

Returns

Type: System.Threading.Tasks.Task

Type Parameters

  • TData -

BatchPutAsync

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

Syntax

public System.Threading.Tasks.Task<TKey[]> BatchPutAsync<TData, TKey>(TData[] data)

Parameters

NameTypeDescription
dataTData[]-

Returns

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

Type Parameters

  • TData -
  • TKey -

ClearStoreAsync

Clears all of the records from a given store.

Syntax

public System.Threading.Tasks.Task ClearStoreAsync()

Returns

Type: System.Threading.Tasks.Task

CountAsync

Count records in ObjectStore

Syntax

public System.Threading.Tasks.Task<int> CountAsync()

Returns

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

CountAsync

Count records in ObjectStore

Syntax

public System.Threading.Tasks.Task<int> CountAsync<TKey>(TKey key)

Parameters

NameTypeDescription
keyTKey-

Returns

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

Type Parameters

  • TKey -

CountAsync

Count records in ObjectStore

Syntax

public System.Threading.Tasks.Task<int> CountAsync<TKey>(CloudNimble.BlazorEssentials.IndexedDb.KeyRange<TKey> key)

Parameters

NameTypeDescription
keyCloudNimble.BlazorEssentials.IndexedDb.KeyRange<TKey>-

Returns

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

Type Parameters

  • TKey -

DeleteAsync

Deletes a record from the store based on the id

Syntax

public System.Threading.Tasks.Task DeleteAsync<TKey>(TKey key) where TKey : notnull

Parameters

NameTypeDescription
keyTKey-

Returns

Type: System.Threading.Tasks.Task

Type Parameters

  • TKey -

Equals Inherited Virtual

Inherited from object

Syntax

public virtual bool Equals(object obj)

Parameters

NameTypeDescription
objobject?-

Returns

Type: bool

Equals Inherited

Inherited from object

Syntax

public static bool Equals(object objA, object objB)

Parameters

NameTypeDescription
objAobject?-
objBobject?-

Returns

Type: bool

GetAllAsync

Gets all of the records in a given store.

Syntax

public System.Threading.Tasks.Task<System.Collections.Generic.List<TResult>> GetAllAsync<TResult>(System.Nullable<int> count = null)

Parameters

NameTypeDescription
countSystem.Nullable<int>-

Returns

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

Type Parameters

  • TResult -

GetAllAsync

Gets all of the records by Key in a given store.

Syntax

public System.Threading.Tasks.Task<System.Collections.Generic.List<TResult>> GetAllAsync<TKey, TResult>(TKey key, System.Nullable<int> count = null)

Parameters

NameTypeDescription
keyTKey-
countSystem.Nullable<int>-

Returns

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

Type Parameters

  • TKey -
  • TResult -

GetAllAsync

Gets all of the records by KeyRange in a given store.

Syntax

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

NameTypeDescription
keyCloudNimble.BlazorEssentials.IndexedDb.KeyRange<TKey>-
countSystem.Nullable<int>-

Returns

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

Type Parameters

  • TKey -
  • TResult -

GetAllAsync

Gets all of the records by ArrayKey in a given store.

Syntax

public System.Threading.Tasks.Task<System.Collections.Generic.List<TResult>> GetAllAsync<TKey, TResult>(TKey[] key)

Parameters

NameTypeDescription
keyTKey[]-

Returns

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

Type Parameters

  • TKey -
  • TResult -

GetAllKeysAsync

Gets all of the records keys in a given store.

Syntax

public System.Threading.Tasks.Task<System.Collections.Generic.List<TResult>> GetAllKeysAsync<TResult>(System.Nullable<int> count = null)

Parameters

NameTypeDescription
countSystem.Nullable<int>-

Returns

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

Type Parameters

  • TResult -

GetAllKeysAsync

Gets all of the records keys by Key in a given store.

Syntax

public System.Threading.Tasks.Task<System.Collections.Generic.List<TResult>> GetAllKeysAsync<TKey, TResult>(TKey key, System.Nullable<int> count = null)

Parameters

NameTypeDescription
keyTKey-
countSystem.Nullable<int>-

Returns

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

Type Parameters

  • TKey -
  • TResult -

GetAllKeysAsync

Gets all of the records by KeyRange in a given store.

Syntax

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

NameTypeDescription
keyCloudNimble.BlazorEssentials.IndexedDb.KeyRange<TKey>-
countSystem.Nullable<int>-

Returns

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

Type Parameters

  • TKey -
  • TResult -

GetAllKeysAsync

Gets all of the records by ArrayKey in a given store.

Syntax

public System.Threading.Tasks.Task<System.Collections.Generic.List<TResult>> GetAllKeysAsync<TKey, TResult>(TKey[] key)

Parameters

NameTypeDescription
keyTKey[]-

Returns

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

Type Parameters

  • TKey -
  • TResult -

GetAsync

Retrieve a record by Key

Syntax

public System.Threading.Tasks.Task<TResult> GetAsync<TKey, TResult>(TKey key)

Parameters

NameTypeDescription
keyTKeythe key of the record

Returns

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

Type Parameters

  • TKey -
  • TResult -

GetHashCode Inherited Virtual

Inherited from object

Syntax

public virtual int GetHashCode()

Returns

Type: int

GetKeyAsync

Retrieve a record key by Key

Syntax

public System.Threading.Tasks.Task<TResult> GetKeyAsync<TKey, TResult>(TKey key)

Parameters

NameTypeDescription
keyTKeythe key of the record

Returns

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

Type Parameters

  • TKey -
  • TResult -

GetType Inherited

Inherited from object

Syntax

public System.Type GetType()

Returns

Type: System.Type

MemberwiseClone Inherited

Inherited from object

Syntax

protected internal object MemberwiseClone()

Returns

Type: object

PutAsync

Updates and existing record

Syntax

public System.Threading.Tasks.Task PutAsync<TData>(TData data) where TData : notnull

Parameters

NameTypeDescription
dataTData-

Returns

Type: System.Threading.Tasks.Task

Type Parameters

  • TData -

PutAsync

Updates and existing record

Syntax

public System.Threading.Tasks.Task<TKey> PutAsync<TData, TKey>(TData data)

Parameters

NameTypeDescription
dataTData-

Returns

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

Type Parameters

  • TData -
  • TKey -

PutAsync

Updates and existing record

Syntax

public System.Threading.Tasks.Task<TKey> PutAsync<TData, TKey>(TData data, TKey key)

Parameters

NameTypeDescription
dataTData-
keyTKey-

Returns

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

Type Parameters

  • TData -
  • TKey -

QueryAsync

Gets all of the records using a filter expression

Syntax

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

NameTypeDescription
filterstringexpression that evaluates to true/false, each record es passed to “obj” parameter
countSystem.Nullable<int>-
skipSystem.Nullable<int>-

Returns

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

Type Parameters

  • TResult -

QueryAsync

Gets all of the records using a filter expression

Syntax

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

NameTypeDescription
namestring-
filterstringexpression that evaluates to true/false, each record es passed to “obj” parameter
keyTKey-
countSystem.Nullable<int>-
skipSystem.Nullable<int>-

Returns

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

Type Parameters

  • TKey -
  • TResult -

QueryAsync

Gets all of the records using a filter expression

Syntax

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

NameTypeDescription
filterstringexpression that evaluates to true/false, each record es passed to “obj” parameter
keyCloudNimble.BlazorEssentials.IndexedDb.KeyRange<TKey>-
countSystem.Nullable<int>-
skipSystem.Nullable<int>-

Returns

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

Type Parameters

  • TKey -
  • TResult -

ReferenceEquals Inherited

Inherited from object

Syntax

public static bool ReferenceEquals(object objA, object objB)

Parameters

NameTypeDescription
objAobject?-
objBobject?-

Returns

Type: bool

ToString Inherited Virtual

Inherited from object

Syntax

public virtual string ToString()

Returns

Type: string?