Exemple #1
0
        /// <summary>
        /// Returns a NameValueCollection of all parameters used for this call.
        /// </summary>
        /// <returns>Name Value collection of parameters</returns>
        private NameValueCollection GetParameters(RequestBase request)
        {
            var nvc = request.GetParameters();

            if (request.RequiresApiToken)
            {
                ParameterValidator.IsNotEmpty(SecurityConfiguration.ApiToken, nameof(SecurityConfiguration.ApiToken));
                nvc.Add("token", SecurityConfiguration.ApiToken);
            }
            if (request.RequiresServiceId)
            {
                ParameterValidator.IsNotEmpty(SecurityConfiguration.ServiceId, nameof(SecurityConfiguration.ServiceId));
                nvc.Add("serviceId", SecurityConfiguration.ServiceId);
            }

            return(nvc);
        }