Pidgin icon indicating copy to clipboard operation
Pidgin copied to clipboard

LINQ query syntax documentation

Open gravityctrl opened this issue 5 years ago • 2 comments

Even though it is stated that LINQ query syntax should be avoided due to performance reduction - Is there a chance, that the documentation could be enhanced by laying out the examples in both syntax styles?

As a learner who tries to get get his head around parsing things, I find myself to be much more comfortable using the LINQ query syntax, as it is much easier to read and understand. That is why I make good progress with understanding Sprache, that has inspired this project.

An alternative Json tutorial would also be an option, if the contributors feel, that the README is blown up enough.

Thank you!

gravityctrl avatar Feb 12 '20 08:02 gravityctrl

I’m always very happy to get documentation pull requests!

benjamin-hodgson avatar Apr 01 '20 05:04 benjamin-hodgson

For future travellers I've just discovered method for understanding/translating LINQ query syntax into method syntax - in dnSpy uncheck the "Decompile query expressions" option and there you go you. Oh and we can actually press F12 on LINQ query keyword like from, where, select - it navigates to Pidgin methods implementing them - SelectMany, Where, Select and this methods call Bind, Assert and Map methods respectively.

Example with dnSpy for TagBody from Xml example:

Original: image

Decompiled: image

image

miloszkukla avatar Jun 15 '20 16:06 miloszkukla