src/AspNetCore/Identity/Identity/src/AccountManaging/Extensions/IHostExtensions.cs
/// <summary>
/// Creates a scope, resolves <see cref="IAccountManager{UserType, RoleType}"/> and invokes <paramref name="handler"/>.
/// </summary>
/// <typeparam name="UserType">The typ of user entity.</typeparam>
/// <typeparam name="RoleType">The type of role entity.</typeparam>
/// <param name="host">The host.</param>
/// <param name="handler">The handler that gets called back.</param>
/// <returns>The host.</returns>
Creates a scope, resolves  and invokes .
Creates a scope resolves and invokes .
public static async Task<IHost> SeedIdentityAsync<UserType, RoleType>(this IHost host, Func<IServiceProvider, IAccountManager<UserType, RoleType>, Task> handler)
        {
            await host.CreateScopeAsync(serviceProvider => {
                var accountManager = serviceProvider.GetRequiredService<IAccountManager<UserType, RoleType>>();
                return handler(serviceProvider, accountManager);
            });
            return host;
        }
public static async Task < IHost > SeedIdentityAsync < UserType , RoleType > ( this IHost host , Func < IServiceProvider , IAccountManager < UserType , RoleType > , Task > handler ) { await host . CreateScopeAsync ( serviceProvider => { var accountManager = serviceProvider . GetRequiredService < IAccountManager < UserType , RoleType > > ( ) ; return handler ( serviceProvider , accountManager ) ; } ) ; return host ; }
Creates a scope, resolves  and invokes .
Creates a scope resolves and invokes .
None
IHost
this
handler
Func<IServiceProvider, IAccountManager<UserType, RoleType>, Task>
The handler that gets called back.
The handler that gets called back .
host
None
typeparam
The typ of user entity.
The typ of user entity .
typeparam
The type of role entity.
The type of role entity .