示例#1
0
            /// <summary>
            /// Gets the retail service configuration.
            /// </summary>
            /// <param name="request">The data service request.</param>
            /// <returns>The data service response.</returns>
            private static SingleEntityDataServiceResponse <RetailServiceConfiguration> GetRetailServiceConfiguration(GetRetailServiceConfigurationDataRequest request)
            {
                var dataManager         = new RetailServiceConfigurationDataManager(request.RequestContext);
                var serverConfiguration = dataManager.GetRetailServiceConfigurationSettings();

                var tenantIdIssuerSettings = serverConfiguration.FirstOrDefault(x => string.Equals(x.Name, AuthenticationTokenIssuersSettingsName));

                var retailServerConfiguration = new RetailServiceConfiguration();

                retailServerConfiguration.AuthenticationTokenIssuers = new List <string>();
                retailServerConfiguration.ServicePrincipalNames      = new List <string>();
                if (tenantIdIssuerSettings != null)
                {
                    retailServerConfiguration.AuthenticationTokenIssuers.Add(tenantIdIssuerSettings.Value);
                }

                return(new SingleEntityDataServiceResponse <RetailServiceConfiguration>(retailServerConfiguration));
            }
示例#2
0
            /// <summary>
            /// Gets the trial plan offer details.
            /// </summary>
            /// <param name="request">The data request for trial plan offer.</param>
            /// <returns>
            /// A entity data service response.
            /// </returns>
            private static SingleEntityDataServiceResponse <bool> GetRetailPlanOffers(GetRetailPlanOffersDataRequest request)
            {
                RetailServiceConfigurationDataManager dataManager = new RetailServiceConfigurationDataManager(request.RequestContext);
                ReadOnlyCollection <RetailServiceConfigurationSetting> serverConfiguration = dataManager.GetRetailServiceConfigurationSettings();
                RetailServiceConfigurationSetting trialModeSettings = serverConfiguration.SingleOrDefault(isTrialMode => string.Equals(isTrialMode.Name, TrialModeKeyName, StringComparison.OrdinalIgnoreCase));
                bool isTrialModeEnabled;

                if (trialModeSettings != null)
                {
                    var intSettingValue = Convert.ToInt32(trialModeSettings.Value.Trim());
                    isTrialModeEnabled = Convert.ToBoolean(intSettingValue);
                }
                else
                {
                    isTrialModeEnabled = false;
                }

                return(new SingleEntityDataServiceResponse <bool>(isTrialModeEnabled));
            }