if condition with nullable

前端 未结 10 1078
抹茶落季
抹茶落季 2021-01-02 10:20

There is a lot of syntax sugar with Nullable like those:

int? parsed to Nullable

int? x = null
   if (x != null) // Parsed          


        
10条回答
  •  伪装坚强ぢ
    2021-01-02 11:06

    Anything between the parentheses from the if-statement must evaluate to true or false. A nullable bool can evaluate to null, true or false.

提交回复
热议问题