Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Extension method: TResult NullOr<TInput, TResult>(this TInput, FuncClassClass<TInput, TResult>)

  • Declared in: RT.Util.Ut

Declaration

public static TResult NullOr<TInput, TResult>(
    this TInput input,
    FuncClassClass<TInput, TResult> lambda
)

Summary

Returns null if the input is null, otherwise the result of the specified lambda when applied to the input.

Generic type parameters

TInput
  • Must be a reference type.
Type of the input value.
TResult
  • Must be a reference type.
Type of the result from the lambda.

Parameters

this TInputinputInput value to check for null.
FuncClassClass<TInput, TResult>lambdaFunction to apply the input value to if it is not null.