Ran across this line of code:
FormsAuth = formsAuth ?? new FormsAuthenticationWrapper();
What do the two question marks mean, is it some ki
If you're familiar with Ruby, its ||=
seems akin to C#'s ??
to me. Here's some Ruby:
irb(main):001:0> str1 = nil
=> nil
irb(main):002:0> str1 ||= "new value"
=> "new value"
irb(main):003:0> str2 = "old value"
=> "old value"
irb(main):004:0> str2 ||= "another new value"
=> "old value"
irb(main):005:0> str1
=> "new value"
irb(main):006:0> str2
=> "old value"
And in C#:
string str1 = null;
str1 = str1 ?? "new value";
string str2 = "old value";
str2 = str2 ?? "another new value";