public SiteSettingInfo GetSiteSetting()
        {
            var settings               = _siteSettingRepository.GetSettingsAsDictionary();
            var allLanguages           = _languageManager.GetAllLanguages();
            var allPages               = GetPages();
            var allAuthenticationTypes = SMTPAuthentication.GetSmtpAuthentications();
            var allThemes              = GetThemes();
            var allLayouts             = _layoutManager.GetPageLayouts();


            var strSiteLanguage              = settings[nameof(SiteSettingInfo.SiteLanguage)];
            var strHomePageId                = settings[nameof(SiteSettingInfo.HomePageId)];
            var strLoginPageId               = settings[nameof(SiteSettingInfo.LoginPageId)];
            var strRegistrationPageId        = settings[nameof(SiteSettingInfo.RegistrationPageId)];
            var strRedirectAfterLoginPageId  = settings[nameof(SiteSettingInfo.RedirectAfterLogin)];
            var strRedirectAfterLogoutPageId = settings[nameof(SiteSettingInfo.RedirectAfterLogout)];

            var strSMTPAuthentication = settings[nameof(SiteSettingInfo.SmtpAuthentication)];
            var strSMTPEnableSSL      = settings[nameof(SiteSettingInfo.SmtpEnableSSL)];

            var strDefaultLayoutId      = settings[nameof(SiteSettingInfo.DefaultLayoutId)];
            var strDefaultTheme         = settings[nameof(SiteSettingInfo.DefaultTheme)];
            var strDefaultAdminLayoutId = settings[nameof(SiteSettingInfo.DefaultAdminLayoutId)];
            var strDefaultAdminTheme    = settings[nameof(SiteSettingInfo.DefaultAdminTheme)];


            var strRegistrationEnabled = settings[nameof(SiteSettingInfo.RegistrationEnabled)];
            var strEnableFacebookAuth  = settings[nameof(SiteSettingInfo.EnableFacebookAuth)];
            var strEnableGoogleAuth    = settings[nameof(SiteSettingInfo.EnableGoogleAuth)];
            var strEnableTwitterAuth   = settings[nameof(SiteSettingInfo.EnableTwitterAuth)];

            var siteSettings = new SiteSettingInfo()
            {
                SiteName        = settings[nameof(SiteSettingInfo.SiteName)],
                SiteDescription = settings[nameof(SiteSettingInfo.SiteDescription)],
                SiteAdminEmail  = settings[nameof(SiteSettingInfo.SiteAdminEmail)],
                SiteRoot        = settings[nameof(SiteSettingInfo.SiteRoot)],
                SiteHeaderTags  = settings[nameof(SiteSettingInfo.SiteHeaderTags)],
                SiteLanguage    = allLanguages.FirstOrDefault(l =>
                                                              string.Equals(l.CultureCode, strSiteLanguage, StringComparison.InvariantCultureIgnoreCase)),

                HomePage            = !string.IsNullOrEmpty(strHomePageId) ? allPages.FirstOrDefault(p => p.Id == Guid.Parse(strHomePageId)) : null,
                LoginPage           = !string.IsNullOrEmpty(strLoginPageId) ? allPages.FirstOrDefault(p => p.Id == Guid.Parse(strLoginPageId)) : null,
                RegistrationPage    = !string.IsNullOrEmpty(strRegistrationPageId) ? allPages.FirstOrDefault(p => p.Id == Guid.Parse(strRegistrationPageId)) : null,
                RedirectAfterLogin  = !string.IsNullOrEmpty(strRedirectAfterLoginPageId) ? allPages.FirstOrDefault(p => p.Id == Guid.Parse(strRedirectAfterLoginPageId)) : null,
                RedirectAfterLogout = !string.IsNullOrEmpty(strRedirectAfterLogoutPageId) ? allPages.FirstOrDefault(p => p.Id == Guid.Parse(strRedirectAfterLogoutPageId)) : null,

                SmtpServerAndPort  = settings[nameof(SiteSettingInfo.SmtpServerAndPort)],
                SmtpAuthentication = allAuthenticationTypes.FirstOrDefault(at => string.Equals(at.Name, strSMTPAuthentication, StringComparison.InvariantCultureIgnoreCase)),
                SmtpEnableSSL      = !string.IsNullOrEmpty(strSMTPEnableSSL) && bool.Parse(strSMTPEnableSSL),
                SmtpUsername       = settings[nameof(SiteSettingInfo.SmtpUsername)],
                SmtpPassword       = settings[nameof(SiteSettingInfo.SmtpPassword)],

                DefaultLayout      = !string.IsNullOrEmpty(strDefaultLayoutId) ? allLayouts.FirstOrDefault(l => l.Id == Guid.Parse(strDefaultLayoutId)) : null,
                DefaultAdminLayout = !string.IsNullOrEmpty(strDefaultAdminLayoutId) ? allLayouts.FirstOrDefault(l => l.Id == Guid.Parse(strDefaultAdminLayoutId)) : null,
                DefaultTheme       = !string.IsNullOrEmpty(strDefaultTheme) ? allThemes.FirstOrDefault(t => t.Id == strDefaultTheme) : null,
                DefaultAdminTheme  = !string.IsNullOrEmpty(strDefaultAdminTheme) ? allThemes.FirstOrDefault(t => t.Id == strDefaultAdminTheme) : null,

                RegistrationEnabled   = !string.IsNullOrEmpty(strRegistrationEnabled) && bool.Parse(strRegistrationEnabled),
                EnableFacebookAuth    = !string.IsNullOrEmpty(strEnableFacebookAuth) && bool.Parse(strEnableFacebookAuth),
                EnableGoogleAuth      = !string.IsNullOrEmpty(strEnableGoogleAuth) && bool.Parse(strEnableGoogleAuth),
                EnableTwitterAuth     = !string.IsNullOrEmpty(strEnableTwitterAuth) && bool.Parse(strEnableTwitterAuth),
                FacebookAppId         = settings[nameof(SiteSettingInfo.FacebookAppId)],
                FacebookAppSecret     = settings[nameof(SiteSettingInfo.FacebookAppSecret)],
                GoogleClientId        = settings[nameof(SiteSettingInfo.GoogleClientId)],
                GoogleClientSecret    = settings[nameof(SiteSettingInfo.GoogleClientSecret)],
                TwitterConsumerKey    = settings[nameof(SiteSettingInfo.TwitterConsumerKey)],
                TwitterConsumerSecret = settings[nameof(SiteSettingInfo.TwitterConsumerSecret)],
            };

            return(siteSettings);
        }