Skip to content
Tracon

TraconSqliteBuilderExtensions

Namespace Tracon · Assembly Tracon.Sqlite.dll

Extensions that add SQLite persistence to the Tracon chain.

public static class TraconSqliteBuilderExtensions

objectTraconSqliteBuilderExtensions

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Enables SQLite persistence by giving a connection string.

public static ITraconBuilder UseSqlite(this ITraconBuilder builder, string connectionString)

builder ITraconBuilder

The Tracon chain.

connectionString string

The SQLite connection string (example: Data Source=tracon.db).

ITraconBuilder

The continuation of the chain.

builder.AddTracon()
.UseSqlite("Data Source=tracon.db");

ArgumentNullException

builder is null.

ArgumentException

connectionString is empty.

UseSqlite(ITraconBuilder, IConfiguration)

Section titled “ UseSqlite(ITraconBuilder, IConfiguration)”

Enables SQLite persistence, reading settings from the Tracon:Sqlite section.

public static ITraconBuilder UseSqlite(this ITraconBuilder builder, IConfiguration configurationSection)

builder ITraconBuilder

The Tracon chain.

configurationSection IConfiguration

The section settings are read from. Usually configuration.GetSection(TraconSqliteOptions.SectionName).

ITraconBuilder

The continuation of the chain.

ArgumentNullException

One of the parameters is null.

UseSqlite(ITraconBuilder, Action<TraconSqliteOptions>)

Section titled “ UseSqlite(ITraconBuilder, Action<TraconSqliteOptions>)”

Enables SQLite persistence by giving settings in code.

public static ITraconBuilder UseSqlite(this ITraconBuilder builder, Action<TraconSqliteOptions> configure)

builder ITraconBuilder

The Tracon chain.

configure Action<TraconSqliteOptions>

The settings mutator.

ITraconBuilder

The continuation of the chain.

Stores are registered with ServiceCollectionDescriptorExtensions.Replace, not TryAdd; the reason is the same as for UseSqlServer/UsePostgreSql

ArgumentNullException

One of the parameters is null.