// This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.Configure <CookiePolicyOptions>(options =>
            {
                // This lambda determines whether user consent for non-essential cookies is needed for a given request.
                options.CheckConsentNeeded    = context => true;
                options.MinimumSameSitePolicy = SameSiteMode.None;
            });

            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);

            services.AddDistributedMemoryCache();
            services.AddSession();

            services.AddTransient <IBasketService, BasketService>();
            var userCounterServiceInstance = new UserCounterService();

            services.AddSingleton <IUserCounterService>(userCounterServiceInstance);

            //services.AddAuthentication()
            //    .AddMicrosoftAccount(options =>
            //    {
            //        options.ClientId = Configuration["ExternalLogin:Microsoft:ClientId"];
            //        options.ClientSecret = Configuration["ExternalLogin:Microsoft:ClientSecret"];
            //    })
            //    .AddGoogle(options =>
            //    {
            //        options.ClientId = Configuration["ExternalLogin:Google:ClientId"];
            //        options.ClientSecret = Configuration["ExternalLogin:Google:ClientSecret"];
            //    });
        }
        private static void ConfigureDI(IServiceCollection services)
        {
            services.AddTransient <IBasketRepository, RedisBasketRepository>();
            services.AddTransient <ICheckoutRepository, CheckoutRepository>();
            services.AddTransient <IProductService, ProductService>();
            services.AddTransient <IProductRepository, EFProductRepository>();
            //services.AddSingleton<IProductRepository, ElasticProductRepository>();
            var userCounterServiceInstance = new UserCounterService();

            services.AddSingleton <IUserCounterService>(userCounterServiceInstance);
        }
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.Configure<CookiePolicyOptions>(options =>
            {
                // This lambda determines whether user consent for non-essential cookies is needed for a given request.
                options.CheckConsentNeeded = context => true;
                options.MinimumSameSitePolicy = SameSiteMode.None;
            });

            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);

            services.AddTransient<IBasketService, BasketService>();
            var userCounterServiceInstance = new UserCounterService();
            services.AddSingleton<IUserCounterService>(userCounterServiceInstance);
        }