Summary
Returns the value or a default value if value is null.
- Assembly
- Cake
.Issues .Reporting .Generic .dll - Namespace
- Cake
.Issues .Reporting .Generic - Containing Type
- ViewBagHelper
Syntax
public static T ValueOrDefault<T>(object value, T defaultValue)
Type Parameters
Name | Description |
---|---|
T | Type of the value. |
Parameters
Name | Type | Description |
---|---|---|
value | object | Value which should be returned. |
defaultValue | T | Value which should be returned if value is null. |
Return Value
Type | Description |
---|---|
T | value or defaultValue if value is null. |