You searched for how does c# work
. We found 81
results in 0.252 seconds.
Just cast: intVal = (int?) dblVal; This will already result in a null value if dblVal is null. Note that unlike Convert.ToInt32(double), this does not result in an exception if dblVal is outside the range of int. If that's a concern,... more
However, when in the clickButton I change the value of the _myParameters, is not changed in the object that was passed as parameter in the constructor of MyClass2. No, it wouldn't be. The value was passed in by value - the two... more
Judging by comments, you're expecting that this lambda expression will only be executed once, while strTemp still has a value of null. s => strTemp == null || !strTemp.Contains(s) That's not the case. It will execute for each element... more
Why does the compiled code on assembly 2 change based on a method signature that (at least I think) should be transparent? No, it shouldn't. When you don't specify an argument to correspond with an optional parameter, the default... more
Fortunately, you can't do this. I say "fortunately" because it's very confusing for the reader. I suggest you just write a method instead, e.g. MergeFrom, so that you're code then reads: // Object initializers used for readability. Foo... more
This is the nasty part, obviously: x += y += x += y; This is executed as: int originalX = x; // Used later x = x + y; // Right-most x += y y = y + x; // Result of "x += y" is the value stored in x x = originalX + y; // Result of "y +=... more
Your two methods are extension methods, which are meant to look like instance methods when they're called. They can be called statically, but you need to supply the instance as the first argument, and specify the class which declares the... more
RFC 7515 defines base64url encoding like this: Base64 encoding using the URL- and filename-safe character set defined in Section 5 of RFC 4648, with all trailing '=' characters omitted (as permitted by Section 3.2) and without the ... more
You're not starting the task - so it will never finish. Use Task.Run instead of new Task and it will create and start the task for you. Note that you're still reading the file synchronously, which isn't ideal... and if your Subject... more
A Date object doesn't have any concept of a time zone. It always represents a number of milliseconds since the Unix epoch. You don't need to do any conversions - you've got the right point in time. (Indeed, there's no sense in which you... more