Working with roslyn to parse the statement correctly.



One of the indispensable tool that helps in constructing / parsing statement using Rosyln is Syntax Tree's Syntax Graph.

THE HARD WAY

Lets's say you have the following codes :-

var myDate2 = new DateTime();

This is easy to write but to do it from Rosyln, there's quite abit of work. To help you understand what to do is using Syntax Tree's Syntax Graph and SyntaxFactory.





From here, you get an idea of what to do .... .To build this using roslyn, use this piece of code.


THE FAST WAY 

Goto http://roslynquoter.azurewebsites.net/ and paste your code and then click "Get Roslyn API to generate this code.








Comments

Popular posts from this blog

The specified initialization vector (IV) does not match the block size for this algorithm