Add default server email rules in migration

This commit is contained in:
Nicolas Dorier
2025-11-09 23:31:51 +09:00
parent dcf60e20b9
commit 3948eb13cd
18 changed files with 174 additions and 28 deletions

View File

@@ -36,6 +36,7 @@ using BTCPayServer.Services.Wallets;
using Microsoft.AspNetCore.DataProtection;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
@@ -454,6 +455,15 @@ namespace BTCPayServer
return services;
}
public static IServiceCollection AddMigration<TDbContext, TMigration>(this IServiceCollection services)
where TDbContext : DbContext
where TMigration : MigrationBase<TDbContext>
{
services.TryAddSingleton<IMigrationExecutor, MigrationExecutor<TDbContext>>();
services.TryAddSingleton<MigrationBase<TDbContext>, TMigration>();
return services;
}
public static async Task CloseSocket(this WebSocket webSocket)
{
try