What do the question mark (?
) and colon (:
) mean?
((OperationURL[1] == "GET") ? GetRequestSignature() : "")
It appears in the following statement:
string requestUri = _apiURL + "?e=" + OperationURL[0] + ((OperationURL[1] == "GET") ? GetRequestSignature() : "");
Best Answer
This is the conditional operator expression.
For example
So if the boolean expression is true, value will hold "Alpha", otherwise, it holds "Beta".
For a common pitfall that people fall into, see this question in the C# tag wiki.