This package provides ModelBuilder
extension methods to allow you to produce the tables expected by the Rebus.SqlServer package
NOTE: You will still need to create migrations to ensure the tables get created. Please see here for further details.
To add the required entities to your DbContext
then following should be added to OnModelCreating
as below:
using LSL.Rebus.EfCore.SqlServer;
...
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
...
modelBuilder.AddRebusSagaTablesForSqlServer();
...
}
The default values are held as constants in the TableNames
static class as TableNames.Saga
&& TableNames.SagaIndex
The default table names are Sagas
and SagaIndex
. To use custom table names pass them into the call as below:
using LSL.Rebus.EfCore.SqlServer;
...
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
...
modelBuilder.AddRebusSagaTablesForSqlServer("CustomSagaTable", "CustomSagaIndexTable");
...
}
To add the required entities to your DbContext
then following should be added to OnModelCreating
as below:
using LSL.Rebus.EfCore.SqlServer;
...
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
...
modelBuilder.AddRebusOutboxTableForSqlServer();
...
}
The default value is held as a constant in the TableNames
static class as TableNames.Outbox
The default table name is Outbox
. To use a custom table name pass the table name into the call as below:
using LSL.Rebus.EfCore.SqlServer;
...
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
...
modelBuilder.AddRebusOutboxTableForSqlServer("CustomOutboxTable");
...
}
To add the required entities to your DbContext
then following should be added to OnModelCreating
as below:
using LSL.Rebus.EfCore.SqlServer;
...
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
...
modelBuilder.AddRebusTimeoutTableForSqlServer();
...
}
The default value is held as a constant in the TableNames
static class as TableNames.Timeouts
The default table name is Timeouts
. To use a custom table name pass the table name into the call as below:
using LSL.Rebus.EfCore.SqlServer;
...
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
...
modelBuilder.AddRebusTimeoutTableForSqlServer("CustomTimeoutsTable");
...
}