I’m looking at the generated code by ASP.NET MVC 1.0, and was wondering; what do the double question marks mean?
// This constructor is not used by the MVC framework but is instead provided for ease // of unit testing this type. See the comments at the end of this file for more // information. public AccountController(IFormsAuthentication formsAuth, IMembershipService service) { FormsAuth = formsAuth ?? new FormsAuthenticationService(); MembershipService = service ?? new AccountMembershipService(); }
This is the null-coalescing operator. It will return the value on its left if that value is not null, else the value on the right (even if it is null). They are often chained together ending in a default value.
Check out this article for more