private static void ConfigureServices(IServiceCollection services) { services .Configure <ApiConfiguration>(configuration => { #if DEBUG configuration.ApiUrl = new Uri("http://localhost:63803", UriKind.Absolute); #else configuration.ApiUrl = new Uri("https://api.money.neptuo.com", UriKind.Absolute); #endif }) .AddAuthorizationCore() .AddSingleton(p => new HttpClient() { BaseAddress = p.GetRequiredService <IOptions <ApiConfiguration> >().Value.ApiUrl }) .AddSingleton <ServerConnectionState>() .AddScoped <ApiAuthenticationStateProvider>() .AddScoped <AuthenticationStateProvider>(provider => provider.GetRequiredService <ApiAuthenticationStateProvider>()) .AddTransient <ApiTokenValidator>() .AddSingleton <SignalRListener>() .AddSingleton <ApiHubService>() .AddTransient <IApiHubState>(provider => provider.GetRequiredService <ApiHubService>()) .AddSingleton <ApiVersionChecker>() .AddTransient <Interop>() .AddSingleton <PwaInstallInterop>() .AddTransient <NetworkStateInterop>() .AddSingleton <NetworkState>() .AddTransient <VisibilityStateInterop>() .AddSingleton <VisibilityState>() .AddSingleton <PullToRefreshInterop>() .AddTransient <CurrencyStorage>() .AddTransient <CategoryStorage>() .AddTransient <ProfileStorage>() .AddTransient <UserPropertyStorage>() .AddTransient <NavigatorUrl>() .AddSingleton <Navigator>() .AddSingleton <Navigator.ModalContainer>() .AddScoped <ApiClient>() .AddSingleton <ModalInterop>() .AddSingleton <TokenContainer>() .AddSingleton <QueryString>() .AddSingleton <CommandMapper>() .AddSingleton <QueryMapper>() .AddSingleton <ColorCollection>() .AddSingleton <IconCollection>(); services .AddTransient <TokenStorage>() .AddBlazoredLocalStorage() .AddBlazoredSessionStorage(); services .AddSingleton <TemplateService>(); bootstrapTask = new Bootstrap.BootstrapTask(services); bootstrapTask.Initialize(); }
private bool TryBootstrap(string launchArguments) { if (BootstrapTask == null) { BootstrapTask = new Bootstrap.BootstrapTask(this, launchArguments); BootstrapTask.Initialize(); return(true); } return(false); }
private bool TryBootstrap() { if (BootstrapTask == null) { BootstrapTask = new Bootstrap.BootstrapTask(); BootstrapTask.Initialize(); return(true); } return(false); }
private static void Main(string[] args) { serviceProvider = new BrowserServiceProvider(services => { services.AddTransient <ApiClient>(); Bootstrap.BootstrapTask bootstrapTask = new Bootstrap.BootstrapTask(services); bootstrapTask.Initialize(); }); new BrowserRenderer(serviceProvider).AddComponent <App>("app"); RegisteredFunction.Invoke <object>("ApplicationStarted", new object[0]); }