What does it mean to add a question mark after a data type in a C # entity class
Public DateTime? createtime{ set {_createtime = value;} get {return _createtime;}}
A question mark (?) in the C # syntax. An operator is a type that can be null.
explanation above:
when working with databases and other data types that contain elements that are not assignable, it is particularly useful to assign NULL to numeric or Boolean and date-type features. For example, a Boolean field in a database can store a value of true or false, or the field may not be defined.
two question marks (??) in the C # syntax Operator is a null merge operator, and the merge operator defines a preset value for a type conversion to prevent null values for nullable types.
MSDN explanation above:
?? Operators are called null Merge operators, which define the default values for types and reference types that can be null values. If the left-hand operand of this operator is not NULL, this operator returns the left operand (the left expression), otherwise the right operand (the right expression) when the left-hand operand is null.