ViewBagHelper.

ValueOrDefault<T>(object, T) Method

Summary

Returns the value or a default value if value is null.

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.
GitHub