Esempio n. 1
0
        public static (int validItems, bool isValid) ValidateParameterLoaders(string objLoaders)
        {
            // get count of loaders
            int paramLoaders = (objLoaders.IndexOf(',') > -1) ? objLoaders.Split(',').Length : 1;

            var validLoaders = ServiceConstants.CCCLoaders();
            var validItems   = 0;

            if (paramLoaders > 1)
            {
                foreach (var item in objLoaders.Split(','))
                {
                    if (!validLoaders.Contains(item.ToLower()))
                    {
                        return(validItems, false);
                    }

                    validItems += 1;
                }

                return(validItems, true);
            }
            else
            {
                return((validLoaders.Contains(objLoaders) ? 1 : 0), validLoaders.Contains(objLoaders));
            }
        }
Esempio n. 2
0
 public static bool ValidateEnvironment(string environment)
 {
     // todo: change this to culture info
     return(ServiceConstants.Environments().Contains(environment.ToLower()));
 }