Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

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

  • Declared in: RT.Util.Ut

Declaration

public static TResult? NullOr<TInput, TResult>(
    this TInput? input,
    FuncStruct<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 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 TInput?inputInput value to check for null.
FuncStruct<TInput, TResult?>lambdaFunction to apply the input value to if it is not null.