Which is preferred: new Nullable<int> or (int?)null ?
- by abatishchev
Which way is preferred in expressions like this:
int? Id
{
get
{
int i;
return Int32.TryParse(Request["id"], out i) ? i : (int?)null;
}
}
is it better to cast on null or create a new Nullable<T> ?