ResultExtensionsLinqMapUnwrapT Method
Unwraps all elements in the collection and returns Ok of the resulting list.
If any of the elements is Err; then, the method returns the mapped error.
var array = new Res<int>[3] { Ok(0), Ok(1), Ok(2) };
Res<List<int>> unwrapped = array.MapUnwrap();
Assert.True(unwrapped.IsOk);
Assert.Equal(new int[3] { 0, 1, 2 }, unwrapped.Unwrap());
var arrayWithErr = new Res<int>[3] { Ok(0), Err<int>("errmsg"), Ok(2) };
Res<List<int>> unwrappedWithErr = arrayWithErr.MapUnwrap();
Assert.True(unwrappedWithErr.IsErr);
Assert.Equal(Some("errmsg"), unwrappedWithErr.ErrorMessage());