Variable type ending with ?

前端 未结 7 2140
别跟我提以往
别跟我提以往 2021-01-04 11:08

What does ? mean:

public bool? Verbose { get; set; }

When applied to string?, there is an error:

7条回答
  •  盖世英雄少女心
    2021-01-04 11:50

    the ? means that your value type can have a null value, specially in the case of database

    handling you need these nullables to check if some value is null or not.

    It can be applied to only value types coz reference types can be null .

提交回复
热议问题