The advantage is the direct check if is null or no
long v = id ?? v2; //if id is null v will get the v2 value
And the performance is pratically the same of a normal one
سؤال
the null-able short hand property
public long? id{get;set}
what is the incentive of using it, other than if you are reading it from a database, is there a chance the value might be null...?
also, if you want to get the id,
int a = id.value;
what is the performance impact on this? and in which situation will you be compelled to use this shorthand. Please share your thoughts on this
المحلول
The advantage is the direct check if is null or no
long v = id ?? v2; //if id is null v will get the v2 value
And the performance is pratically the same of a normal one