For quite a long time I tried to study Roslyn , but like all of us, I ran into a single problem: there was absolutely no time for that. How is this question usually solved? We go to a lot of resources and look for reports and articles on the topic of interest to us and how we repeat the author’s movements as a template, which shows how to use it. What do we encounter when looking for descriptions of the topics proposed on the CLR ium ? We do not find anything . Ie, of course, Google gives out something on the requests of “Roslyn”, “Roslyn samples”, but nevertheless these are chewed examples a thousand times, and, moreover, ancient as mammoths by the standards of release of new CTP versions. This is important because the availability of information implies the development of a particular infrastructure. And the coolest but not the only article on Roslyn at the moment is this:
Roslyn to automatically translate C # code into 1C codepublic (int, int) ReturnCoords() { return (0, 0); } var (x, y) = ReturnCoords(); match (i) { | 1 => Console.WriteLine(1) | 2 => Console.WriteLine(2) | x => Console.WriteLine(x) } match (i) { | x when (x < 0) => WriteLine("negative") | x when (x > 36) => WriteLine("more than 36") | x when (x % 2 == 0)=> WriteLine($"valid even number $x") | x => WriteLine($"valid odd number $x") } match (obj) { | iDisp is IDisposable => iDisp.Dispose() | _ => (); } 
sunex.development@gmail.com
+7 (921) 948-16-08Source: https://habr.com/ru/post/247237/
All Articles