|
|
|
@ -134,28 +134,28 @@ namespace Ombi.DependencyInjection
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void RegisterStore(this IServiceCollection services) {
|
|
|
|
|
services.AddEntityFrameworkSqlite().AddDbContext<OmbiContext>();
|
|
|
|
|
services.AddEntityFrameworkSqlite().AddDbContext<SettingsContext>();
|
|
|
|
|
services.AddEntityFrameworkSqlite().AddDbContext<ExternalContext>();
|
|
|
|
|
services.AddDbContext<OmbiContext>();
|
|
|
|
|
services.AddDbContext<SettingsContext>();
|
|
|
|
|
services.AddDbContext<ExternalContext>();
|
|
|
|
|
|
|
|
|
|
services.AddScoped<IOmbiContext, OmbiContext>(); // https://docs.microsoft.com/en-us/aspnet/core/data/entity-framework-6
|
|
|
|
|
services.AddScoped<ISettingsContext, SettingsContext>(); // https://docs.microsoft.com/en-us/aspnet/core/data/entity-framework-6
|
|
|
|
|
services.AddScoped<IExternalContext, ExternalContext>(); // https://docs.microsoft.com/en-us/aspnet/core/data/entity-framework-6
|
|
|
|
|
services.AddTransient<ISettingsRepository, SettingsJsonRepository>();
|
|
|
|
|
services.AddTransient<ISettingsResolver, SettingsResolver>();
|
|
|
|
|
services.AddTransient<IPlexContentRepository, PlexServerContentRepository>();
|
|
|
|
|
services.AddTransient<IEmbyContentRepository, EmbyContentRepository>();
|
|
|
|
|
services.AddTransient<INotificationTemplatesRepository, NotificationTemplatesRepository>();
|
|
|
|
|
services.AddScoped<ISettingsRepository, SettingsJsonRepository>();
|
|
|
|
|
services.AddScoped<ISettingsResolver, SettingsResolver>();
|
|
|
|
|
services.AddScoped<IPlexContentRepository, PlexServerContentRepository>();
|
|
|
|
|
services.AddScoped<IEmbyContentRepository, EmbyContentRepository>();
|
|
|
|
|
services.AddScoped<INotificationTemplatesRepository, NotificationTemplatesRepository>();
|
|
|
|
|
|
|
|
|
|
services.AddTransient<ITvRequestRepository, TvRequestRepository>();
|
|
|
|
|
services.AddTransient<IMovieRequestRepository, MovieRequestRepository>();
|
|
|
|
|
services.AddTransient<IMusicRequestRepository, MusicRequestRepository>();
|
|
|
|
|
services.AddTransient<IAuditRepository, AuditRepository>();
|
|
|
|
|
services.AddTransient<IApplicationConfigRepository, ApplicationConfigRepository>();
|
|
|
|
|
services.AddTransient<ITokenRepository, TokenRepository>();
|
|
|
|
|
services.AddTransient(typeof(ISettingsService<>), typeof(SettingsService<>));
|
|
|
|
|
services.AddTransient(typeof(IRepository<>), typeof(Repository<>));
|
|
|
|
|
services.AddTransient(typeof(IExternalRepository<>), typeof(ExternalRepository<>));
|
|
|
|
|
services.AddScoped<ITvRequestRepository, TvRequestRepository>();
|
|
|
|
|
services.AddScoped<IMovieRequestRepository, MovieRequestRepository>();
|
|
|
|
|
services.AddScoped<IMusicRequestRepository, MusicRequestRepository>();
|
|
|
|
|
services.AddScoped<IAuditRepository, AuditRepository>();
|
|
|
|
|
services.AddScoped<IApplicationConfigRepository, ApplicationConfigRepository>();
|
|
|
|
|
services.AddScoped<ITokenRepository, TokenRepository>();
|
|
|
|
|
services.AddScoped(typeof(ISettingsService<>), typeof(SettingsService<>));
|
|
|
|
|
services.AddScoped(typeof(IRepository<>), typeof(Repository<>));
|
|
|
|
|
services.AddScoped(typeof(IExternalRepository<>), typeof(ExternalRepository<>));
|
|
|
|
|
}
|
|
|
|
|
public static void RegisterServices(this IServiceCollection services)
|
|
|
|
|
{
|
|
|
|
@ -163,7 +163,7 @@ namespace Ombi.DependencyInjection
|
|
|
|
|
services.AddTransient<INotificationService, NotificationService>();
|
|
|
|
|
services.AddTransient<IEmailProvider, GenericEmailProvider>();
|
|
|
|
|
services.AddTransient<INotificationHelper, NotificationHelper>();
|
|
|
|
|
services.AddTransient<ICacheService, CacheService>();
|
|
|
|
|
services.AddSingleton<ICacheService, CacheService>();
|
|
|
|
|
|
|
|
|
|
services.AddTransient<IDiscordNotification, DiscordNotification>();
|
|
|
|
|
services.AddTransient<IEmailNotification, EmailNotification>();
|
|
|
|
|