Skip to main content

Definition

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

Syntax

CloudNimble.BlazorEssentials.IndexedDb.IndexedDbDatabase

Summary

Provides functionality for accessing IndexedDB from Blazor application

Constructors

.ctor

Syntax

public IndexedDbDatabase(Microsoft.JSInterop.IJSRuntime jsRuntime)

Parameters

NameTypeDescription
jsRuntimeMicrosoft.JSInterop.IJSRuntime-

.ctor Inherited

Inherited from object

Syntax

public Object()

Properties

DatabaseDefinition

Syntax

public CloudNimble.BlazorEssentials.IndexedDb.Schema.IndexedDbDatabaseDefinition DatabaseDefinition { get; internal set; }

Property Value

Type: CloudNimble.BlazorEssentials.IndexedDb.Schema.IndexedDbDatabaseDefinition

Name

Syntax

public string Name { get; init; }

Property Value

Type: string

ObjectStores

Syntax

public System.Collections.Generic.List<CloudNimble.BlazorEssentials.IndexedDb.IndexedDbObjectStore> ObjectStores { get; private set; }

Property Value

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

Version

Syntax

public int Version { get; set; }

Property Value

Type: int

Methods

CallJavaScriptAsync

Syntax

public System.Threading.Tasks.Task CallJavaScriptAsync(string functionName, params object[] args)

Parameters

NameTypeDescription
functionNamestring-
argsobject[]-

Returns

Type: System.Threading.Tasks.Task

Exceptions

ExceptionDescription
IndexedDbException

CallJavaScriptAsync

Syntax

public System.Threading.Tasks.Task<TResult> CallJavaScriptAsync<TResult>(string functionName, params object[] args)

Parameters

NameTypeDescription
functionNamestring-
argsobject?[]-

Returns

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

Type Parameters

  • TResult -

Exceptions

ExceptionDescription
IndexedDbException

ConsoleLog

Syntax

public System.Threading.Tasks.Task ConsoleLog(params object[] args)

Parameters

NameTypeDescription
argsobject[]-

Returns

Type: System.Threading.Tasks.Task

Exceptions

ExceptionDescription
IndexedDbException

CreateObjectStoreAsync

This function provides the means to add a store to an existing database,

Syntax

public System.Threading.Tasks.Task CreateObjectStoreAsync(CloudNimble.BlazorEssentials.IndexedDb.IndexedDbObjectStore objectStore)

Parameters

NameTypeDescription
objectStoreCloudNimble.BlazorEssentials.IndexedDb.IndexedDbObjectStore-

Returns

Type: System.Threading.Tasks.Task

DeleteDatabaseAsync

Deletes this IndexedDb instance from the browser.

Syntax

public System.Threading.Tasks.Task DeleteDatabaseAsync()

Returns

Type: System.Threading.Tasks.Task

EnsureIsOpenAsync

Syntax

public System.Threading.Tasks.Task EnsureIsOpenAsync()

Returns

Type: System.Threading.Tasks.Task

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

GetHashCode Inherited Virtual

Inherited from object

Syntax

public virtual int GetHashCode()

Returns

Type: int

GetType Inherited

Inherited from object

Syntax

public System.Type GetType()

Returns

Type: System.Type

LoadSchemaAsync

Load database schema from databaseName

Syntax

public System.Threading.Tasks.Task LoadSchemaAsync()

Returns

Type: System.Threading.Tasks.Task

MemberwiseClone Inherited

Inherited from object

Syntax

protected internal object MemberwiseClone()

Returns

Type: object

OpenAsync

Opens the IndexedDB defined in the DbDatabase. Under the covers will create the database if it does not exist and create the stores defined in DbDatabase.

Syntax

public System.Threading.Tasks.Task OpenAsync()

Returns

Type: System.Threading.Tasks.Task

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?