In C# - Optional parameters - creates a completion to the other un-supplied parameters.
so if I write:
void Go(int a, bool isFalse = true)
and call Go(a)
it actually emit il code for Go(a, true).
What about named parameters and how does switching the order thing works behind the scenes?
for example :
Go(isFalse:true, a:1) //order has been switched.
For example, if you have something like this
void Go ( int a , bool isFalse, bool isEmpty)
After your call Go(1,isEmpty : true, isFalse : false) it will generate function call like this
Go ( 1, false, true)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With