Example #1
0
        public static string ToFilter(CartoFilterSet filterSet, CartoReaderContext cntx)
        {
            string result = string.Empty;

            if (filterSet.Count > 0)
            {
                int i = 0;
                foreach (CartoFilterElement filter in filterSet.Filters)
                {
                    if (i != 0)
                    {
                        result += " and ";
                    }

                    result += cntx.Translator.ToFilter(cntx.GetValue(filter.Key), ToExpressionOperator(filter.Op), ToExpressionValue(filter.Value, cntx));
                    i++;
                }
            }

            return(result);
        }
        public static string ToFilter(CartoFilterSet filterSet, ICartoTranslator cartoTranslator)
        {
            string result = string.Empty;

            if (filterSet.Count > 0)
            {
                int i = 0;
                foreach (CartoFilterElement filter in filterSet.Filters)
                {
                    if (i != 0)
                    {
                        result += " and ";
                    }

                    result += cartoTranslator.ToFilter(filter.Key.ToString(), ToExpressionOperator(filter.Op), ToExpressionValue(filter.Value));
                    i++;
                }
            }

            return(result);
        }