Provides extension methods for delegate Converter<TInput, TOutput> and predefined converters.
Namespace: DotNext Assembly: DotNext.dll Syntaxpublic static class Converter
Methods | Edit this page View Source AsFunc<TInput, TOutput>(Converter<TInput, TOutput>)
Converts Converter<TInput, TOutput> into Func<T, TResult>.
Declarationpublic static Func<TInput, TOutput> AsFunc<TInput, TOutput>(this Converter<TInput, TOutput> converter)
Parameters Type Name Description Converter<TInput, TOutput> converter
The converted delegate.
Returns Type Description Func<TInput, TOutput>A delegate of type Func<T, TResult> referencing the same method as original delegate.
Type Parameters Name Description TInputThe type of input argument.
TOutputReturn type of the function.
| Edit this page View Source AsPredicate<T>(Converter<T, bool>)Converts Converter<TInput, TOutput> into predicate.
Declarationpublic static Predicate<T> AsPredicate<T>(this Converter<T, bool> converter)
Parameters Type Name Description Converter<T, bool> converter
A delegate to convert.
Returns Type Description Predicate<T>A delegate of type Predicate<T> referencing the same method as original delegate.
Type Parameters Name Description TType of predicate argument.
| Edit this page View Source Identity<T>()The converter which returns input argument without any modifications.
Declarationpublic static Converter<T, T> Identity<T>()
Returns Type Description Converter<T, T>
The identity function.
Type Parameters Name Description TThe type of input and output.
| Edit this page View Source Identity<TInput, TOutput>()The converter which returns input argument without any modifications.
Declarationpublic static Converter<TInput, TOutput> Identity<TInput, TOutput>() where TInput : TOutput
Returns Type Description Converter<TInput, TOutput>
The identity function.
Type Parameters Name Description TInputType of input.
TOutputType of output.
| Edit this page View Source TryInvoke<TInput, TOutput>(Converter<TInput, TOutput>, TInput)Converts the input value without throwing exception.
Declarationpublic static Result<TOutput> TryInvoke<TInput, TOutput>(this Converter<TInput, TOutput> converter, TInput input)
Parameters Type Name Description Converter<TInput, TOutput> converter
The converter to invoke.
TInput inputThe input value to be converted.
Returns Type Description Result<TOutput>The conversion result.
Type Parameters Name Description TInputThe type of the value to be converted.
TOutputThe type of the conversion result.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4