Skip to main content

Definition

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

Syntax

CloudNimble.BlazorEssentials.IndexedDb.IndexedDbIndex

Summary

Defines an Index for a given object store.

Constructors

.ctor

Syntax

public IndexedDbIndex(CloudNimble.BlazorEssentials.IndexedDb.IndexedDbObjectStore objectStore, string name, string keyPath, bool multiEntry = false, bool unique = false)

Parameters

NameTypeDescription
objectStoreCloudNimble.BlazorEssentials.IndexedDb.IndexedDbObjectStore-
namestring-
keyPathstring-
multiEntrybool-
uniquebool-

Exceptions

ExceptionDescription
IndexedDbException

.ctor Inherited

Inherited from object

Syntax

public Object()

Properties

Database

Syntax

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

Property Value

Type: CloudNimble.BlazorEssentials.IndexedDb.IndexedDbDatabase

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

public string KeyPath { get; }

Property Value

Type: string

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

public bool MultiEntry { get; }

Property Value

Type: bool

Name

The name of the index.

Syntax

public string Name { get; }

Property Value

Type: string

ObjectStore

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

Syntax

public CloudNimble.BlazorEssentials.IndexedDb.IndexedDbObjectStore ObjectStore { get; init; }

Property Value

Type: CloudNimble.BlazorEssentials.IndexedDb.IndexedDbObjectStore

Unique

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

Syntax

public bool Unique { get; }

Property Value

Type: bool

Methods

CountAsync

Count records in Index

Syntax

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

Returns

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

CountAsync

Count records in Index

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 Index

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 -

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 that match a given query in the specified index.

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 that match a given query in the specified index.

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 that match a given query in the specified index.

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 that match a given query in the specified index.

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 that match a given query in the specified index.

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 that match a given query in the specified index.

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 that match a given query in the specified index.

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 that match a given query in the specified index.

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

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

Syntax

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

Parameters

NameTypeDescription
queryValueTKey-

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

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

Syntax

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

Parameters

NameTypeDescription
keyTKey-

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

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 filter, 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
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?