private static bool ContainsAttribute(Collection<CustomAttribute> customAttributes, string attributeTypeName) { if (customAttributes == null) { return false; } return customAttributes.Any(x => x.AttributeType.FullName.Contains(attributeTypeName)); }