Tuesday, August 27, 2019

Chaining the C# null coalescing ?? Operator

Simple example

string partner = Request.QueryString["GoogleId"] ?? 
                 Request.QueryString["PartnerId"] ?? 
                 Request.QueryString["UserKey"] ?? 
                 string.Empty;

No comments :