using Microsoft.Extensions.DependencyInjection; namespace PnvPanel.Infrastructure.Identity; public static class DbInitializerExtensions { public static async Task SeedDataAsync( this IServiceProvider services, CancellationToken cancellationToken = default ) { await using var scope = services.CreateAsyncScope(); var initializer = scope.ServiceProvider.GetRequiredService(); await initializer.SeedAsync(cancellationToken); } }