.NET API
TraconSqlServerBuilderExtensions
Tracon.SqlServer.dllExtensions that add SQL Server persistence to the Tracon chain.
public static class TraconSqlServerBuilderExtensionsInheritance
Section titled “Inheritance”object ← TraconSqlServerBuilderExtensions
Inherited Members
Section titled “Inherited Members”object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Methods
Section titled “Methods”UseSqlServer(ITraconBuilder, string)
Section titled “ UseSqlServer(ITraconBuilder, string)”Enables SQL Server persistence given a connection string.
public static ITraconBuilder UseSqlServer(this ITraconBuilder builder, string connectionString)Parameters
Section titled “Parameters”builder ITraconBuilder
The Tracon chain.
connectionString string
The SQL Server connection string.
Returns
Section titled “Returns”The continuation of the chain.
Remarks
Section titled “Remarks”builder.AddTracon() .UseSqlServer(builder.Configuration.GetConnectionString("Tracon")!);Exceptions
Section titled “Exceptions”builder is null.
connectionString is empty.
UseSqlServer(ITraconBuilder, IConfiguration)
Section titled “ UseSqlServer(ITraconBuilder, IConfiguration)”Enables SQL Server persistence, reading settings from the Tracon:SqlServer section.
public static ITraconBuilder UseSqlServer(this ITraconBuilder builder, IConfiguration configurationSection)Parameters
Section titled “Parameters”builder ITraconBuilder
The Tracon chain.
configurationSection IConfiguration
The section settings are read from. Usually
configuration.GetSection(TraconSqlServerOptions.SectionName).
Returns
Section titled “Returns”The continuation of the chain.
Exceptions
Section titled “Exceptions”One of the parameters is null.
UseSqlServer(ITraconBuilder, Action<TraconSqlServerOptions>)
Section titled “ UseSqlServer(ITraconBuilder, Action<TraconSqlServerOptions>)”Enables SQL Server persistence with settings given in code.
public static ITraconBuilder UseSqlServer(this ITraconBuilder builder, Action<TraconSqlServerOptions> configure)Parameters
Section titled “Parameters”builder ITraconBuilder
The Tracon chain.
configure Action<TraconSqlServerOptions>
The settings mutator.
Returns
Section titled “Returns”The continuation of the chain.
Remarks
Section titled “Remarks”Stores are registered with ServiceCollectionDescriptorExtensions.Replace,
not TryAdd. AddTracon has already registered the
in-memory stores with TryAddSingleton and runs before this
call in the chain; using TryAdd here would silently do nothing.
Overwriting is correct here because UseSqlServer is the
consumer’s explicit choice. The “register with TryAdd”
rule is for Tracon’s defaults, not for explicit calls.
Exceptions
Section titled “Exceptions”One of the parameters is null.