public static OptimizerService.OrdinalDimension EncodeOrdinalDimension(OrdinalDimension dimension)
        {
            var instance = new OptimizerService.OrdinalDimension();

            instance.Name      = dimension.Name;
            instance.Ascending = dimension.Ascending;
            instance.OrderedValues.AddRange(
                dimension.OrderedValues.Select(value => EncodePrimitiveValue(value)));

            return(instance);
        }
        public static OrdinalDimension DecodeOrdinalDimension(OptimizerService.OrdinalDimension dimension)
        {
            object[] values = dimension.OrderedValues.Select(value => DecodePrimitiveValue(value)).ToArray();

            return(new OrdinalDimension(name: dimension.Name, ascending: dimension.Ascending, orderedValues: values));
        }