Patrick Hofman's answer is ideal for the OP case, as it returns true / false very accurately. For a more general case , if this is the way to go :
User.UserRoleID == 9 ? doOneStuff() : doTheOtherStuff()
it is easy to replace it with equivalent if / else
if(User.UserRoleID == 9){
doOneStuff();
}else{
doTheOtherStuff();
}
In the case of assignments and returns, you need to express the left side in both branches:
int foo = (User.UserRoleID == 9) ? doOneStuff() : doTheOtherStuff()
if(User.UserRoleID == 9){
int foo = doOneStuff();
}else{
int foo = doTheOtherStuff();
}
, , :
int result = myFunction(User.UserRoleID == 9 ? 4 : 5)
int parameter;
if(User.UserRoleID == 9){
parameter = 4;
}else{
parameter = 5;
}
result = myFunction(parameter);