Skip to content

Can create tenant scope using CreateScope? #9943

Answered by ns8482e
ns8482e asked this question in Q&A
Discussion options

You must be logged in to vote

Finally figured out how to create scope by using tenant name

            var host = CreateHostBuilder(args).Build();
            using var appServices = host.Services.CreateScope();
            var tenanthost = appServices.ServiceProvider.GetService<IShellHost>();

             await tenanthost.InitializeAsync();

            var list = tenanthost.ListShellContexts();
            // Get Tenant services.
            var services = await tenanthost.GetScopeAsync("Default");

Replies: 1 comment

Comment options

ns8482e
Sep 10, 2021
Collaborator Author

You must be logged in to vote
0 replies
Answer selected by ns8482e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant