/// <summary> /// Checks the constraint. /// </summary> /// <param name="parameterType">Type of the parameter.</param> /// <param name="typeToCheck">The type to check.</param> /// <returns></returns> public bool CheckConstraint(GenericParameterType parameterType, TypeBase typeToCheck) { foreach (var genericParameterConstraint in ParameterConstraints) { if (genericParameterConstraint.Name == parameterType.Name) { return(genericParameterConstraint.Constraint(typeToCheck)); } } return(false); }
/// <summary> /// Checks the constraint. /// </summary> /// <param name="parameterType">Type of the parameter.</param> /// <param name="typeToCheck">The type to check.</param> /// <returns></returns> public bool CheckConstraint(GenericParameterType parameterType, TypeBase typeToCheck) { foreach (var genericParameterConstraint in ParameterConstraints) { if (genericParameterConstraint.Name == parameterType.Name) { return genericParameterConstraint.Constraint(typeToCheck); } } return false; }