Example #1
0
        /// <summary>
        /// Returns a key containing one ordinary key segment per given value.
        /// </summary>
        /// <param name="values">the values for each key column that will be used to compose the key</param>
        /// <returns>A key containing one ordinary key segment per given value.</returns>
        /// <seealso cref="ComposeWildcard"/>
        /// <seealso cref="ComposePrefix"/>
        public static Key Compose(params object[] values)
        {
            Key key = new Key();

            foreach (object value in values)
            {
                key.Add(value);
            }

            return(key);
        }
Example #2
0
        /// <summary>
        /// Returns a key containing one ordinary key segment per given value
        /// except that the last given value becomes a prefix key segment.
        /// </summary>
        /// <param name="values">the values for each key column that will be used to compose the key</param>
        /// <returns>A key containing one ordinary key segment per given value
        /// except that the last given value becomes a prefix key segment.</returns>
        /// <seealso cref="Compose"/>
        /// <seealso cref="ComposeWildcard"/>
        public static Key ComposePrefix(params object[] values)
        {
            Key key = new Key();

            for (int i = 0; i < values.Length - 1; i++)
            {
                key.Add(values[i]);
            }

            key.AddPrefix(values[values.Length - 1]);
            return(key);
        }
Example #3
0
        /// <summary>
        /// Returns a key containing one ordinary key segment per given value
        /// and one wildcard key segment.
        /// </summary>
        /// <param name="values">the values for each key column that will be used to compose the key</param>
        /// <returns>A key containing one ordinary key segment per given value
        /// and one wildcard key segment.</returns>
        /// <seealso cref="Compose"/>
        /// <seealso cref="ComposePrefix"/>
        public static Key ComposeWildcard(params object[] values)
        {
            Key key = new Key();
            foreach (object value in values)
            {
                key.Add(value);
            }

            key.AddWildcard();
            return key;
        }
Example #4
0
        /// <summary>
        /// Returns a key containing one ordinary key segment per given value
        /// except that the last given value becomes a prefix key segment.
        /// </summary>
        /// <param name="values">the values for each key column that will be used to compose the key</param>
        /// <returns>A key containing one ordinary key segment per given value
        /// except that the last given value becomes a prefix key segment.</returns>
        /// <seealso cref="Compose"/>
        /// <seealso cref="ComposeWildcard"/>
        public static Key ComposePrefix(params object[] values)
        {
            Key key = new Key();
            for (int i = 0; i < values.Length - 1; i++)
            {
                key.Add(values[i]);
            }

            key.AddPrefix(values[values.Length - 1]);
            return key;
        }