This is also known as "inline if" or, as indicated above, for the ternary operator. https://en.wikipedia.org/wiki/%3F :
He used to shorten the code, although it is not recommended to use many of them on one line, as this can complicate code execution. Imagine:
a = b?c:(d?e:(f?g:h));
and you can continue.
It ends basically the same as the entry:
if(b) a = c; else if(d) a = e; else if(f) a = g; else a = h;
In your case, "string requestUri = _apiURL +"? e = "+ OperationURL [0] + ((OperationURL [1] ==" GET ")? GetRequestSignature ():" ");"
It can also be written as: (else exception, since this is an empty string)
string requestUri = _apiURL + "?e=" + OperationURL[0]; if((OperationURL[1] == "GET") requestUri = requestUri + GetRequestSignature();
or like this:
string requestUri; if((OperationURL[1] == "GET") requestUri = _apiURL + "?e=" + OperationURL[0] + GetRequestSignature(); else requestUri = _apiURL + "?e=" + OperationURL[0];
Depending on your preference / code style, your boss tells you to use.
TS Apr 08 '16 at 14:17 2016-04-08 14:17
source share