Published
- 1 min read
linq FirstOrDefault int return nullable
The solution for this is noted below
linq FirstOrDefault int return nullable
Solution
int? nullableId = GetNonNullableInts().Cast<int?>().FirstOrDefault();
Try other methods by searching on the site. That is if this doesn’t work