public static CodeAttributeArgument FindArgument(this CodeAttributeDeclaration attributeDeclaration, string argumentName) { return attributeDeclaration.Arguments .OfType<CodeAttributeArgument>() .FirstOrDefault(a => a.Name == argumentName); }