M_CommandLine_ParserResultExtensions_MapResult__2 - adutton/commandline GitHub Wiki
ParserResultExtensions.MapResult(T1, TResult) Method (ParserResult(Object), Func(T1, TResult), Func(IEnumerable(Error), TResult))
Provides a way to transform result data into another value.
Namespace: CommandLine
Assembly: CommandLine (in CommandLine.dll) Version: 0.0.0
C#
public static TResult MapResult<T1, TResult>(
this ParserResult<Object> result,
Func<T1, TResult> parsedFunc1,
Func<IEnumerable<Error>, TResult> notParsedFunc
)VB
<ExtensionAttribute>
Public Shared Function MapResult(Of T1, TResult) (
result As ParserResult(Of Object),
parsedFunc1 As Func(Of T1, TResult),
notParsedFunc As Func(Of IEnumerable(Of Error), TResult)
) As TResultC++
public:
[ExtensionAttribute]
generic<typename T1, typename TResult>
static TResult MapResult(
ParserResult<Object^>^ result,
Func<T1, TResult>^ parsedFunc1,
Func<IEnumerable<Error^>^, TResult>^ notParsedFunc
)F#
[<ExtensionAttribute>]
static member MapResult :
result : ParserResult<Object> *
parsedFunc1 : Func<'T1, 'TResult> *
notParsedFunc : Func<IEnumerable<Error>, 'TResult> -> 'TResult
- result
- Type: CommandLine.ParserResult(Object)
The result in verb scenario. - parsedFunc1
- Type: System.Func(T1, TResult)
Lambda executed on successful parsing of T1. - notParsedFunc
- Type: System.Func(IEnumerable(Error), TResult)
Lambda executed on failed parsing.
- T1
- First verb type.
- TResult
Type: TResult
The new value.
In Visual Basic and C#, you can call this method as an instance method on any object of type ParserResult(Object). When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
ParserResultExtensions Class
MapResult Overload
CommandLine Namespace