DbContext class separated.
This commit is contained in:
20
code/MessengerBroker.Db.Sql/BrokerSqlDbContext.cs
Normal file
20
code/MessengerBroker.Db.Sql/BrokerSqlDbContext.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace MessengerBroker.Db.Sql
|
||||
{
|
||||
public class BrokerSqlDbContext : BrokerDbContext
|
||||
{
|
||||
private readonly string connectionString;
|
||||
|
||||
public BrokerSqlDbContext(string connectionString)
|
||||
{
|
||||
this.connectionString = connectionString;
|
||||
}
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
base.OnConfiguring(optionsBuilder);
|
||||
optionsBuilder.UseSqlServer(this.connectionString);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user