Пример #1
0
 public BaseTest(ClientHost aWebAssemblyHost)
 {
     ServiceScopeFactory = aWebAssemblyHost.ServiceProvider.GetService <IServiceScopeFactory>();
     ServiceScope        = ServiceScopeFactory.CreateScope();
     Mediator            = ServiceScope.ServiceProvider.GetService <IMediator>();
     Store = ServiceScope.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);
        }