Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

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

  • Declared in: RT.Util.Ut

Declaration

public static TResult NullOr<TInput, TResult>(
    this TInput? input,
    FuncStructClass<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 derive from: System.ValueType.
  • Must have a default constructor.
  • Must be a non-nullable value type.
Type of the input value.
TResult
  • Must be a reference type.
Type of the result from the lambda.

Parameters

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