Extensions for inline-transformations of nullable values C# treats structs and classes differently in regards to how the nullable boxing is done, so there's an overload for both types.
More...
|
static ? TRes | TransformIfExists< T, TRes > (this T? nullable, Func< T, TRes > transformation) |
| Takes a nullable struct, and if it is not-null, applies the given transformation to it. If it is null, the transformation function is not applied. More...
|
|
static ? TRes | TransformIfExists< T, TRes > (this T? nullable, Func< T, TRes > transformation) |
| Takes a nullable class, and if it is not-null, applies the given transformation to it. If it is null, the transformation function is not applied. More...
|
|
Extensions for inline-transformations of nullable values C# treats structs and classes differently in regards to how the nullable boxing is done, so there's an overload for both types.
◆ TransformIfExists< T, TRes >() [1/2]
static ? TRes TransformIfExists< T, TRes > |
( |
this T? |
nullable, |
|
|
Func< T, TRes > |
transformation |
|
) |
| |
|
inlinestatic |
Takes a nullable struct, and if it is not-null, applies the given transformation to it. If it is null, the transformation function is not applied.
◆ TransformIfExists< T, TRes >() [2/2]
static ? TRes TransformIfExists< T, TRes > |
( |
this T? |
nullable, |
|
|
Func< T, TRes > |
transformation |
|
) |
| |
|
inlinestatic |
Takes a nullable class, and if it is not-null, applies the given transformation to it. If it is null, the transformation function is not applied.
The documentation for this class was generated from the following file: