Exemple #1
0
 public LocationsDataHandler()
 {
     Redirects.Add("id", new LocationsDataIdHandler());
     Redirects.Add("within", new LocationsDataWithinHandler());
     Redirects.Add("top", new LocationsDataTopHandler());
     Redirects.Add("all", new LocationsDataAllHandler());
 }
Exemple #2
0
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);

            services.AddScoped <StatisticsContext>();

            var redirects = new Redirects(Configuration.GetSection("Redirects")
                                          .GetChildren()
                                          .ToDictionary(k => k.Key, v => v.Value));

            redirects.Add("", "");

            services.AddSingleton(redirects);
        }