internal static CompilationUnitSyntax AddObsoleteAttribute(this CompilationUnitSyntax root, ref ConstructorDeclarationSyntax constructorDeclaration, string message = null) { var arguments = !string.IsNullOrWhiteSpace(message) ? SyntaxFactory.ParseAttributeArgumentList($"(\"{message}\")") : default; return(root.AddCustomAttribute(ref constructorDeclaration, "Obsolete", arguments)); }