Storage.Sqlite - dotnet-shashlik/shashlik.eventbus GitHub Wiki
Nuget: Shashlik.EventBus.Sqlite
。
/// <summary>
/// 使用连接字符串初始化注册Sqlite存储
/// </summary>
/// <param name="service"></param>
/// <param name="connectionString">连接字符串</param>
/// <param name="publishTableName">已发布消息表名,默认eventbus_published</param>
/// <param name="receiveTableName">已接收消息表名,默认eventbus_received</param>
/// <returns></returns>
public static IEventBusBuilder AddSqlite(
this IEventBusBuilder service,
string connectionString,
string? publishTableName = null,
string? receiveTableName = null);
/// <summary>
/// 使用DbContext注册Sqlite存储
/// </summary>
/// <param name="service"></param>
/// <param name="publishTableName">已发布消息表名,默认eventbus_published</param>
/// <param name="receiveTableName">已接收消息表名,默认eventbus_received</param>
/// <typeparam name="TDbContext">数据库上下文类型</typeparam>
/// <returns></returns>
public static IEventBusBuilder AddSqlite<TDbContext>(
this IEventBusBuilder service,
string? publishTableName = null,
string? receiveTableName = null)
where TDbContext : DbContext;
/// <summary>
/// 使用Sqlite存储
/// </summary>
/// <param name="eventBusBuilder"></param>
/// <param name="optionsAction"></param>
/// <returns></returns>
public static IEventBusBuilder AddSqlite(this IEventBusBuilder eventBusBuilder, Action<EventBusSqliteOptions>? optionsAction = null);
-
PublishedTableName
:已发布消息表名,默认值eventbus_published
。 -
ReceivedTableName
:已接收消息表名,默认值eventbus_published
。 -
DbContextType
:EF数据库上下文类型,无默认值,和ConnectionString
必须配置其中一项。 -
ConnectionString
:数据库连接字符串,无默认值,有DbContextType
参数时,此参数无效。