Bifrost.FluentValidation.Commands.CommandValidatorProvider.RegisterValidator C# (CSharp) Method

RegisterValidator() static private method

static private RegisterValidator ( Type typeToRegister, IDictionary validatorRegistry ) : void
typeToRegister System.Type
validatorRegistry IDictionary
return void
        void RegisterValidator(Type typeToRegister, IDictionary<Type, List<Type>> validatorRegistry)
        {
            var validatedType = GetValidatedType(typeToRegister);

            if (validatedType == null || validatedType.IsInterface || validatedType.IsAPrimitiveType())
                return;

            if (validatorRegistry.ContainsKey(validatedType))
            {
               validatorRegistry[validatedType].Add(typeToRegister);
            }
            else
            {
                validatorRegistry.Add(validatedType, new List<Type>() { typeToRegister });
            }   
        }