Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

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

  • Declared in: RT.Util.Ut

Declaration

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

Parameters

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