Exemplo n.º 1
0
        public string AppendDeleteByQueryParametersToPath(string path, DeleteByQueryParameters urlParameters)
        {
            if (urlParameters == null)
            {
                return(path);
            }

            var parameters = new Dictionary <string, string>();

            if (urlParameters.Replication != Replication.Sync)             //sync == default
            {
                parameters.Add("replication", urlParameters.Replication.ToString().ToLower());
            }

            if (urlParameters.Consistency != Consistency.Quorum)             //quorum == default
            {
                parameters.Add("consistency", urlParameters.Replication.ToString().ToLower());
            }

            if (!urlParameters.Routing.IsNullOrEmpty())
            {
                parameters.Add("routing", urlParameters.Routing);
            }

            path = AppendEscapedQueryString(parameters, path);
            return(path);
        }
Exemplo n.º 2
0
        public string AppendDeleteByQueryParametersToPath(string path, DeleteByQueryParameters urlParameters)
        {
            if (urlParameters == null)
            {
                return(path);
            }

            var parameters = new List <string>();

            if (urlParameters.Replication != Replication.Sync)             //sync == default
            {
                parameters.Add("replication=" + urlParameters.Replication.ToString().ToLower());
            }

            if (urlParameters.Consistency != Consistency.Quorum)             //quorum == default
            {
                parameters.Add("consistency=" + urlParameters.Replication.ToString().ToLower());
            }

            if (!urlParameters.Routing.IsNullOrEmpty())
            {
                parameters.Add("routing=" + urlParameters.Routing);
            }

            path += "?" + string.Join("&", parameters.ToArray());
            return(path);
        }