<commit_before>﻿using System;
using System.IO;
using System.Linq.Expressions;
using System.Reactive.Linq;

using CloudBoilerplateNet.Helpers;
using CloudBoilerplateNet.Models;
using CloudBoilerplateNet.Resolvers;
using CloudBoilerplateNet.Services;
using CloudBoilerplateNet.Helpers.Extensions;
using KenticoCloud.Delivery;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Rewrite;
using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;

namespace CloudBoilerplateNet
{
    public class Startup
    {
        public IConfiguration Configuration { get; }

        public Startup(IConfiguration configuration)
        {
            Configuration = configuration;
        }

        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            // Adds services required for using options.
            services.AddOptions();

            // Register the IConfiguration instance which ProjectOptions binds against.
            services.Configure<ProjectOptions>(Configuration);

            services.AddSingleton<IWebhookListener>(sp => new WebhookListener());
            services.AddSingleton<IDependentTypesResolver>(sp => new DependentFormatResolver());
            services.AddSingleton<ICacheManager>(sp => new ReactiveCacheManager(
                sp.GetRequiredService<IOptions<ProjectOptions>>(), 
                sp.GetRequiredService<IMemoryCache>(), 
                sp.GetRequiredService<IDependentTypesResolver>(), 
                sp.GetRequiredService<IWebhookListener>()));

            services.AddSingleton<IDeliveryClient>(sp => new CachedDeliveryClient(
                sp.GetRequiredService<IOptions<ProjectOptions>>(), 
                sp.GetRequiredService<ICacheManager>())
            {<commit_msg>Added missing service filter registration.<commit_after>﻿using System;
using System.IO;
using System.Linq.Expressions;
using System.Reactive.Linq;

using CloudBoilerplateNet.Filters;
using CloudBoilerplateNet.Helpers;
using CloudBoilerplateNet.Helpers.Extensions;
using CloudBoilerplateNet.Models;
using CloudBoilerplateNet.Resolvers;
using CloudBoilerplateNet.Services;
using KenticoCloud.Delivery;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Rewrite;
using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;

namespace CloudBoilerplateNet
{
    public class Startup
    {
        public IConfiguration Configuration { get; }

        public Startup(IConfiguration configuration)
        {
            Configuration = configuration;
        }

        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            // Adds services required for using options.
            services.AddOptions();

            // Register the IConfiguration instance which ProjectOptions binds against.
            services.Configure<ProjectOptions>(Configuration);

            services.AddSingleton<IWebhookListener>(sp => new WebhookListener());
            services.AddSingleton<IDependentTypesResolver>(sp => new DependentFormatResolver());
            services.AddSingleton<ICacheManager>(sp => new ReactiveCacheManager(
                sp.GetRequiredService<IOptions<ProjectOptions>>(), 
                sp.GetRequiredService<IMemoryCache>(), 
                sp.GetRequiredService<IDependentTypesResolver>(), 
                sp.GetRequiredService<IWebhookListener>()));

            services.AddScoped<KenticoCloudSignatureActionFilter>();

            services.AddSingleton<IDeliveryClient>(sp => new CachedDeliveryClient(
                sp.GetRequiredService<IOptions<ProjectOptions>>(), 
                sp.GetRequiredService<ICacheManager>())
            {
{'fraction_non_alphanumeric': 0.07894736842105263, 'fraction_numerical': 0.0, 'mean_word_length': 3.4168443496801704, 'pattern_counts': {'":': 0, '<': 30, '<?xml version=': 0, '>': 38, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6428090', 'n_tokens_mistral': 1015, 'n_tokens_neox': 981, 'n_words': 211}