mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
Update EF
This commit is contained in:
+3
-2
@@ -32,9 +32,10 @@ namespace Kruzya.TelegramBot.Core
|
||||
foreach (var module in _core.Modules) services.AddSingleton(module.GetType(), module);
|
||||
|
||||
// Add database context to DI.
|
||||
var connectionString = _core.Configuration.GetConnectionString("DefaultConnection");
|
||||
services.AddDbContext<CoreContext>(ctx =>
|
||||
ctx.UseMySql(_core.Configuration.GetConnectionString("DefaultConnection")));
|
||||
|
||||
ctx.UseMySql(connectionString, ServerVersion.AutoDetect(connectionString)));
|
||||
|
||||
// Trigger module handlers.
|
||||
_core.Modules.ConfigureServices(services);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user