Ejemplo n.º 1
0
        /// <summary>
        /// Gets the forced variation key for the given user and experiment.
        /// </summary>
        /// <param name="experimentKey">The experiment key</param>
        /// <param name="userId">The user ID</param>
        /// <returns>null|string The variation key.</returns>
        public Variation GetForcedVariation(string experimentKey, string userId)
        {
            var config = ProjectConfigManager?.GetConfig();

            if (config == null)
            {
                return(null);
            }

            var inputValues = new Dictionary <string, string>
            {
                { USER_ID, userId },
                { EXPERIMENT_KEY, experimentKey }
            };

            if (!ValidateStringInputs(inputValues))
            {
                return(null);
            }

            return(DecisionService.GetForcedVariation(experimentKey, userId, config));
        }