A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://dotnet.github.io/dotNext/api/DotNext.Converter.html below:

Class Converter | .NEXT

Class Converter

Provides extension methods for delegate Converter<TInput, TOutput> and predefined converters.

Namespace: DotNext Assembly: DotNext.dll Syntax
public static class Converter
Methods | Edit this page View Source AsFunc<TInput, TOutput>(Converter<TInput, TOutput>)

Converts Converter<TInput, TOutput> into Func<T, TResult>.

Declaration
public 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 TInput

The type of input argument.

TOutput

Return type of the function.

| Edit this page View Source AsPredicate<T>(Converter<T, bool>)

Converts Converter<TInput, TOutput> into predicate.

Declaration
public 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 T

Type of predicate argument.

| Edit this page View Source Identity<T>()

The converter which returns input argument without any modifications.

Declaration
public static Converter<T, T> Identity<T>()
Returns Type Description Converter<T, T>

The identity function.

Type Parameters Name Description T

The type of input and output.

| Edit this page View Source Identity<TInput, TOutput>()

The converter which returns input argument without any modifications.

Declaration
public static Converter<TInput, TOutput> Identity<TInput, TOutput>() where TInput : TOutput
Returns Type Description Converter<TInput, TOutput>

The identity function.

Type Parameters Name Description TInput

Type of input.

TOutput

Type of output.

| Edit this page View Source TryInvoke<TInput, TOutput>(Converter<TInput, TOutput>, TInput)

Converts the input value without throwing exception.

Declaration
public 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 input

The input value to be converted.

Returns Type Description Result<TOutput>

The conversion result.

Type Parameters Name Description TInput

The type of the value to be converted.

TOutput

The 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