feat: exorcise entity framework core from most responders
This commit is contained in:
parent
33b78a7ac5
commit
5891f28f7c
32 changed files with 743 additions and 145 deletions
|
|
@ -22,6 +22,8 @@ using Catalogger.Backend.Cache;
|
|||
using Catalogger.Backend.Cache.InMemoryCache;
|
||||
using Catalogger.Backend.Cache.RedisCache;
|
||||
using Catalogger.Backend.Database;
|
||||
using Catalogger.Backend.Database.Dapper;
|
||||
using Catalogger.Backend.Database.Dapper.Repositories;
|
||||
using Catalogger.Backend.Database.Queries;
|
||||
using Catalogger.Backend.Database.Redis;
|
||||
using Catalogger.Backend.Services;
|
||||
|
|
@ -103,6 +105,9 @@ public static class StartupExtensions
|
|||
public static IServiceCollection AddCustomServices(this IServiceCollection services) =>
|
||||
services
|
||||
.AddSingleton<IClock>(SystemClock.Instance)
|
||||
.AddDatabasePool()
|
||||
.AddScoped<DapperMessageRepository>()
|
||||
.AddScoped<GuildRepository>()
|
||||
.AddSingleton<GuildCache>()
|
||||
.AddSingleton<RoleCache>()
|
||||
.AddSingleton<ChannelCache>()
|
||||
|
|
@ -113,7 +118,7 @@ public static class StartupExtensions
|
|||
.AddSingleton<NewsService>()
|
||||
.AddScoped<IEncryptionService, EncryptionService>()
|
||||
.AddSingleton<MetricsCollectionService>()
|
||||
.AddScoped<MessageRepository>()
|
||||
// .AddScoped<MessageRepository>()
|
||||
.AddSingleton<WebhookExecutorService>()
|
||||
.AddSingleton<PkMessageHandler>()
|
||||
.AddSingleton(InMemoryDataService<Snowflake, ChannelCommandData>.Instance)
|
||||
|
|
@ -189,6 +194,8 @@ public static class StartupExtensions
|
|||
.ServiceProvider.GetRequiredService<IClock>()
|
||||
.GetCurrentInstant();
|
||||
|
||||
DatabasePool.ConfigureDapper();
|
||||
|
||||
await using (var db = scope.ServiceProvider.GetRequiredService<DatabaseContext>())
|
||||
{
|
||||
var migrationCount = (await db.Database.GetPendingMigrationsAsync()).Count();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue