Given this question shorthand If Statements: C#
What is wrong with this?
int userID;
Int32.TryParse(request.userID, out userID);
userID > 0 ? user = DuoUser.LoadUser(userID): ;
It gives the error:
only assignment call increment decrement and new object expressions can be used as a statement
As far as I can see it should work, but something is wrong?
EDIT:
I have also tried:
int userID = 0;
userID > 0 ? user = DuoUser.LoadUser(userID): null;
But it still gives the same error.