AccidentalFish.ApplicationSupport.Powershell.NewApplicationResources.GetCorsMethods C# (CSharp) Метод

GetCorsMethods() приватный статический Метод

private static GetCorsMethods ( string verbString ) : CorsHttpMethods
verbString string
Результат CorsHttpMethods
        private static CorsHttpMethods GetCorsMethods(string verbString)
        {
            Dictionary<string, CorsHttpMethods> lookup = new Dictionary<string, CorsHttpMethods>
            {
                {"PUT", CorsHttpMethods.Put},
                {"POST", CorsHttpMethods.Post},
                {"GET", CorsHttpMethods.Get},
                {"DELETE", CorsHttpMethods.Delete},
                {"HEAD", CorsHttpMethods.Head},
                {"OPTIONS", CorsHttpMethods.Options},
                {"TRACE", CorsHttpMethods.Trace},
                {"MERGE", CorsHttpMethods.Merge},
                {"CONNECT", CorsHttpMethods.Connect}
            };

            CorsHttpMethods result = CorsHttpMethods.None;
            string[] verbs = verbString.Split(',');
            foreach (string verb in verbs)
            {
                result |= lookup[verb];
            }
            return result;
        }