DateAndOrTimeConvertTArg, TResult(TArg, FuncDateOnly, TArg, TResult, FuncDateTimeOffset, TArg, TResult, FuncTimeOnly, TArg, TResult, FuncString, TArg, TResult) Method

Converts the encapsulated value to TResult and allows to specify an argument for the conversion.

Definition

Namespace: FolkerKinzel.VCards.Models
Assembly: FolkerKinzel.VCards (in FolkerKinzel.VCards.dll) Version: 8.0.1+a91cc3f0fd39aeb548e16006a60ca9dd10a304a2
C#
public abstract TResult Convert<TArg, TResult>(
	TArg arg,
	Func<DateOnly, TArg, TResult> dateFunc,
	Func<DateTimeOffset, TArg, TResult> dtoFunc,
	Func<TimeOnly, TArg, TResult> timeFunc,
	Func<string, TArg, TResult> stringFunc
)

Parameters

arg  TArg
The argument to pass to the delegates.
dateFunc  FuncDateOnly, TArg, TResult
The FuncT, TResult to call if the encapsulated value is a DateOnly value.
dtoFunc  FuncDateTimeOffset, TArg, TResult
The FuncT, TResult to call if the encapsulated value is a DateTimeOffset value.
timeFunc  FuncTimeOnly, TArg, TResult
The FuncT, TResult to call if the encapsulated value is a TimeOnly value.
stringFunc  FuncString, TArg, TResult
The FuncT, TResult to call if the encapsulated value is a String.

Type Parameters

TArg
Generic type parameter for the type of the argument to pass to the delegates.
TResult
Generic type parameter for the return type of the delegates.

Return Value

TResult
A TResult.

Exceptions

ArgumentNullException One of the arguments is null and the encapsulated value is of that Type.

See Also