コード例 #1
0
 public BaseTest(ClientHost aWebAssemblyHost)
 {
     Console.WriteLine("BaseTest");
     ServiceScopeFactory = aWebAssemblyHost.ServiceProvider.GetService <IServiceScopeFactory>();
     ServiceScope        = ServiceScopeFactory.CreateScope();
     ServiceProvider     = ServiceScope.ServiceProvider;
     Mediator            = ServiceProvider.GetService <IMediator>();
     Store = ServiceProvider.GetService <IStore>();
 }
コード例 #2
0
        private void ConfigureWebAssemblyHost(ServiceCollection aServiceCollection)
        {
            //var webAssemblyHostBuilder = WebAssemblyHostBuilder.CreateDefault();
            //ConfigureServices(webAssemblyHostBuilder.Services);

            //WebAssemblyHost webAssemblyHost = webAssemblyHostBuilder.Build();
            //aServiceCollection.AddSingleton(webAssemblyHost);

            var clientHostBuilder = ClientHostBuilder.CreateDefault();

            ConfigureServices(clientHostBuilder.Services);

            ClientHost clientHost = clientHostBuilder.Build();

            aServiceCollection.AddSingleton(clientHost);
        }