0
0

Remove unnecessary TSetting type parameter from ISettingsDbContext & just use ISetting instead

This commit is contained in:
Rhys Ickeringill
2025-12-28 16:45:14 +11:00
parent b7848d71d6
commit 0c824f268c
8 changed files with 25 additions and 31 deletions

View File

@@ -19,7 +19,7 @@ public static class ServiceCollectionExtensions
/// <remarks>If your connection string contains a password then this method may not work, please use another overload</remarks>
/// <exception cref="NullReferenceException">If your <typeparamref name="TDbContext"/> does not have a connection string</exception>
public static IServiceCollection AddSqlServerNotificationConfigurationReloadService<TDbContext, TSetting>(this IServiceCollection services)
where TDbContext : DbContext, ISettingsDbContext<DbSet<TSetting>, TSetting>
where TDbContext : DbContext, ISettingsDbContext<IQueryable<TSetting>>
where TSetting : class, ISetting
{
var optionsBuilder = services.AddCoreServices<TDbContext, TSetting>();
@@ -49,7 +49,7 @@ public static class ServiceCollectionExtensions
/// </param>
/// <returns>The service collection it was called on now with added services</returns>
public static IServiceCollection AddSqlServerNotificationConfigurationReloadService<TDbContext, TSetting>(this IServiceCollection services, Action<Options> configure)
where TDbContext : DbContext, ISettingsDbContext<DbSet<TSetting>, TSetting>
where TDbContext : DbContext, ISettingsDbContext<IQueryable<TSetting>>
where TSetting : class, ISetting
{
var optionsBuilder = services.AddCoreServices<TDbContext, TSetting>();
@@ -61,7 +61,7 @@ public static class ServiceCollectionExtensions
private static OptionsBuilder<Options> AddCoreServices<TDbContext, TSetting>(this IServiceCollection services)
where TDbContext : DbContext, ISettingsDbContext<DbSet<TSetting>, TSetting>
where TDbContext : DbContext, ISettingsDbContext<IQueryable<TSetting>>
where TSetting : class, ISetting
{
services.AddSingleton(static provider =>