I have something that takes List<int?>
and I have a List<int>
.
I can write:
var items = value.Select(num => (int?) num).ToList();
But is that really the simplest method?
Would this work?
var items = value.Cast<int?>().ToList();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With