i sometimes use this kind of if in my code:
!Value == null ? DoSomething : DoSomethingElse;
and i was wondering what is the proper name for an if else statement like that.
also, i wonder if there can only be a if part, without the else in the same structure.
It’s called a conditional operator. It is a ternary operator (and the only one), but that’s not what it’s called.
You can’t use it as you can use an if statement. You can only use it where you need it to return one of two values. The two values need to be the same type, or an implicit conversion needs to exist between them.