Ran across this line of code:
FormsAuth = formsAuth ?? new FormsAuthenticationWrapper();
What do the two question marks mean, is it some ki
Just because no-one else has said the magic words yet: it's the null coalescing operator. It's defined in section 7.12 of the C# 3.0 language specification.
It's very handy, particularly because of the way it works when it's used multiple times in an expression. An expression of the form:
a ?? b ?? c ?? d
will give the result of expression a
if it's non-null, otherwise try b
, otherwise try c
, otherwise try d
. It short-circuits at every point.
Also, if the type of d
is non-nullable, the type of the whole expression is non-nullable too.