1

I have some code: partial void FuncName(TimeSpan? value) What does having the nullable operator there allow me to do? If it wasn't there could I not pass a null TimeSpan at all? Do I need it for every argument I pass that could be null?

Thanks

ss7
  • 2,902
  • 7
  • 41
  • 90

2 Answers2

2

The ? is for nullable, it will allow you to pass null in the TimeSpan.

Nullable Types

Nullable types are instances of the System.Nullable struct. A nullable type can represent the correct range of values for its underlying value type, plus an additional null value. For example, a Nullable, pronounced "Nullable of Int32," can be assigned any value from -2147483648 to 2147483647, or it can be assigned the null value.

Adil
  • 146,340
  • 25
  • 209
  • 204
1

The sign ? with DataType indicates that Datatype is nullable.

You can read more about Nullable types here

Hari Prasad
  • 16,716
  • 4
  • 21
  • 35