I am trying to figure how to expand this lambda function into a regular block of code, but can't seem to get it right.
public static IntPtr GetCurrentProcess() => new IntPtr(-1);
Could someone point me in the right direction? Thanks!
I am trying to figure how to expand this lambda function into a regular block of code, but can't seem to get it right.
public static IntPtr GetCurrentProcess() => new IntPtr(-1);
Could someone point me in the right direction? Thanks!
Per what CodeReaper said in the comments, you can get Visual Studio to toggle between block body and expression body:
Click on the method name to put the caret in it, then open the light bulb menu in the margin. Sometimes the lightbulb is a wrench instead. You can also press Ctrl+. to pop this menu, and it has a lot of useful stuff in different contexts, such as writing string s
as a new parameter to your constructor and then doing "Add and init field" to add a class level field and a setter for it in the constructor body; worth looking into all the things it can do