Exemplo n.º 1
0
        /// <summary>
        /// Creates a new Gigya DS helper with the settings for <paramref name="siteId"/>.
        /// </summary>
        public static GigyaUmbracoDsHelper Instance(int siteId)
        {
            var logger         = LoggerFactory.Instance();
            var settingsHelper = new GigyaUmbracoDsSettingsHelper(logger);
            var dsSettings     = settingsHelper.Get(siteId);

            var coreSettingsHelper = new GigyaSettingsHelper();
            var coreSettings       = coreSettingsHelper.Get(siteId, true);

            var helper = new GigyaUmbracoDsHelper(coreSettings, logger, dsSettings);

            return(helper);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates a new Gigya DS helper with the settings for <paramref name="siteId"/>.
        /// </summary>
        public static GigyaSitefinityDsHelper Instance(Guid siteId)
        {
            var logger         = LoggerFactory.Instance();
            var settingsHelper = new GigyaSitefinityDsSettingsHelper(logger);
            var dsSettings     = settingsHelper.Get(siteId);

            var coreSettingsHelper = new GigyaSettingsHelper();
            var coreSettings       = coreSettingsHelper.Get(siteId, true);

            // merge ds data with account info
            var helper = new GigyaSitefinityDsHelper(coreSettings, logger, dsSettings);

            return(helper);
        }
        private bool Validate(GigyaDsSettings settings, ref GigyaDsSettingsResponseModel responseModel)
        {
            var coreSettingsHelper = new GigyaSettingsHelper();
            var coreSettings       = coreSettingsHelper.Get(settings.SiteId, true);

            var dsHelper = new GigyaDsHelper(coreSettings, _logger, settings);

            var errorMessage = dsHelper.Validate();

            if (!string.IsNullOrEmpty(errorMessage))
            {
                responseModel.Error = errorMessage;
                _logger.Error(responseModel.Error);
                return(false);
            }

            return(true);
        }