Result_T_.GetValueOrDefault.md
January 20, 2026 ยท View on GitHub
Atypical.VirtualFileSystem.Core
Atypical.VirtualFileSystem.Core.Result<T>
Result<T>.GetValueOrDefault Method
| Overloads | |
|---|---|
| GetValueOrDefault(Func<string,T>) | Gets the value if successful, or gets a value from the specified function. |
| GetValueOrDefault(T) | Gets the value if successful, or returns the specified default value. |
Result<T>.GetValueOrDefault(Func<string,T>) Method
Gets the value if successful, or gets a value from the specified function.
public T GetValueOrDefault(System.Func<string,T> defaultValueFactory);
Parameters
defaultValueFactory System.Func<System.String,T>
Function to create default value from error message.
Returns
T
The success value or the result of the default value factory.
Result<T>.GetValueOrDefault(T) Method
Gets the value if successful, or returns the specified default value.
public T GetValueOrDefault(T defaultValue=default(T));
Parameters
defaultValue T
The default value to return on failure.
Returns
T
The success value or the default value.