コード例 #1
0
        /// <summary>
        /// Gets an <see cref="IEnumerable{T}"/> of the verb strings.
        /// </summary>
        /// <param name="verbs"><see cref="RestVerbs"/> to get an enumeration of.</param>
        /// <returns>The <see cref="IEnumerable{T}"/> of verb <see cref="string"/>s.</returns>
        public static IEnumerable <string> ToEnumerable(this RestVerbs verbs)
        {
            if (verbs == RestVerbs.Any)
            {
                return new[] { verbs.ToString().ToUpper() }
            }
            ;

            return(verbs
                   .ToString()
                   .ToUpper()
                   .Split(',')
                   .Select(x => x.Trim()));
        }
コード例 #2
0
 protected static string BuildCompositKey(string path, RestVerbs verb)
 {
     return($"{CleanRoutePath(path)}:{verb.ToString().ToUpperInvariant()}");
 }