public static void AddBehlogServices(
            this IServiceCollection services,
            IConfiguration configuration)
        {
            services.Configure <BehlogSetting>(configuration.Bind);
            var appSetting     = GetAppSetting(services);
            var websiteOptions = appSetting.WebsiteSeedInfo.Options;

            services.AddSingleton <BehlogSetting>(appSetting);
            services.AddSingleton <WebsiteOptionSetting>(websiteOptions);
            services.AddSingleton <GlobalViewData>(appSetting.ViewData);
            services.AddScoped <IDateService, DateService>();
            services.AddIdentityOptions(appSetting);
            services.AddSecurityServices();
            services.AddDatabaseServices(appSetting);
            services.AddHttpServices();
            services.AddDatabaseCacheStores(appSetting);
            services.AddDynamicPermissions();
            services.AddFactories();
            services.AddRepositories();
            services.AddValidators();
            services.AddServices();
            services.AddViewModelProviders();
            services.AddExtensions();
            services.AddScoped <IWebsiteInfo>(_ => {
                var service = _.GetService <IWebsiteService>();
                var result  = service.GetWebsiteInfo(appSetting.WebsiteId).Result;
                return(result != null ? result : null);
            });

            MappingConfig.AddDtoMappingConfig();
            Behlog.Web.Mapping.MappingConfig.AddViewModelMappingConfig();
        }