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>(); }
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); }