Changing Syntax Tree uing Roslyn API
A syntax tree has knowledge about the textual content of what it represents and that content relates to C#. There are scenarios that we need to change the code, such as code fixes, refactorings, or advanced source generation, and it could be done through changing the syntax tree; since this is a bidirectional relationship. There are two approaches, Replacement Methods and SyntaxRewriter classes