Toggle side menu
Toggle side menu
Blog
Documentation
Reference
Extensions
Community
API
Support Us
Source
ViewBagHelper
.
ValueOrDefault
<T>
(object,
T)
Method
This content is part of a third party extension that is not supported by the Cake project. For more information about this extension see
Cake.Issues.Reporting.Generic
.
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.