Open redundancer opened 3 years ago
private static void Main(string[] args){ var number = MyMethod1(); // How to use number in method 2? } int? MyMethod1(){ return 1; } void MyMethod2(Option<uint> aNumber){ // Do Something. }
You can use a combination of ToOption and Map:
ToOption
Map
int? value = 0; var x = value.ToOption("Value is null").Map(v => (uint)v);