Exemple #1
0
        public void OnApplicationStartup(IServiceCollection services)
        {
            var tokenizer = new LatinTokenizer();

            services.AddSingleton(typeof(LocalStorageSessionFactory), new LocalStorageSessionFactory(Path.Combine(Directory.GetCurrentDirectory(), "App_Data"), tokenizer));
            services.Add(new ServiceDescriptor(typeof(ITokenizer), tokenizer));
        }
Exemple #2
0
        public void OnApplicationStartup(IServiceCollection services, ServiceProvider serviceProvider)
        {
            var tokenizer = new LatinTokenizer();
            var config    = serviceProvider.GetService <IConfigurationService>();

            services.AddSingleton(typeof(SessionFactory),
                                  new SessionFactory(
                                      config.Get("data_dir"),
                                      tokenizer,
                                      config));

            services.AddSingleton(typeof(ITokenizer), tokenizer);

            services.AddSingleton(typeof(HttpQueryParser), new HttpQueryParser(new KeyValueBooleanQueryParser()));
        }
Exemple #3
0
        public void OnApplicationStartup(IServiceCollection services, ServiceProvider serviceProvider)
        {
            var tokenizer = new LatinTokenizer();
            var config    = serviceProvider.GetService <IConfigurationProvider>();

            services.AddSingleton(typeof(SessionFactory),
                                  new SessionFactory(
                                      config.Get("data_dir"),
                                      tokenizer,
                                      config));

            services.AddSingleton(typeof(ITokenizer), tokenizer);

            services.AddSingleton(typeof(HttpQueryParser), new HttpQueryParser(new TermQueryParser(), tokenizer));
            services.AddSingleton(typeof(HttpBowQueryParser), new HttpBowQueryParser(tokenizer));
            services.AddSingleton(typeof(IQueryFormatter), new QueryFormatter());
        }