コード例 #1
0
        public static IServiceCollection AddSimplyRazor(this IServiceCollection serviceCollection, Action <ComponentOptions> configure = null)
        {
            var componentOptions = new ComponentOptions();

            if (configure != null)
            {
                configure.Invoke(componentOptions);
            }
            serviceCollection.AddSingleton(componentOptions);

            serviceCollection.AddHttpClient <ApiService>((serviceProvider, httpClient) =>
            {
                httpClient.BaseAddress = componentOptions.ApiBaseUri;
            });

            serviceCollection.AddScoped <JwtStore>();

            serviceCollection.AddScoped <Notifier <UserMessage> >();
            serviceCollection.AddScoped <Notifier <InvalidFieldNotification> >();
            return(serviceCollection.AddScoped <NotifyService>());
        }
コード例 #2
0
ファイル: JwtStore.cs プロジェクト: simplify9/SimplyRazor
        //private bool jwtNotPresent;

        public JwtStore(AuthenticationStateProvider authenticationStateProvider, ComponentOptions componentOptions)
        {
            this.authenticationStateProvider = authenticationStateProvider;
            this.componentOptions            = componentOptions;
        }