Skip to content

CreateAsync Method ​

Definition ​

  • Namespace: JASE.Database
  • Assembly: JASE.Database.dll

Overloads ​

NameDescription
Task<IDatabaseSession> CreateAsync()Asynchronously creates a new database session using the default registration name defined in the factory options.
Task<IDatabaseSession> CreateAsync(string name)Asynchronously creates a new database session using the named registration.

Task<IDatabaseSession> CreateAsync() ​

csharp
Task<IDatabaseSession> CreateAsync()

Asynchronously creates a new database session using the default registration name defined in the factory options.

Returns ​

A task that resolves to a newly created IDatabaseSession instance.

Remarks ​

This method resolves the default registration configured for the factory and creates a session from that registration asynchronously.

Task<IDatabaseSession> CreateAsync(string name) ​

csharp
Task<IDatabaseSession> CreateAsync(string name)

Asynchronously creates a new database session using the named registration.

Parameters ​

NameDescription
nameThe logical registration name used to resolve the database session configuration.

Returns ​

A task that resolves to a newly created IDatabaseSession instance.

Remarks ​

Registration names are typically resolved using a case-insensitive comparison. Implementations may create sessions from a registered DatabaseConfig or from provider-specific settings such as database type and connection string.