Project SQL function coalesce() Note: throws an exception outside of a QueryOver expression

Namespace: NHibernate.Criterion
Assembly: NHibernate (in NHibernate.dll) Version: 3.2.0.4000 (3.2.0.4000)

Syntax

C#
public static Nullable<T> Coalesce<T>(
	this Nullable<T> objectProperty,
	T replaceValueIfIsNull
)
where T : struct, new()
Visual Basic
<ExtensionAttribute> _
Public Shared Function Coalesce(Of T As {Structure, New}) ( _
	objectProperty As Nullable(Of T), _
	replaceValueIfIsNull As T _
) As Nullable(Of T)
Visual C++
[ExtensionAttribute]
public:
generic<typename T>
where T : value class, gcnew()
static Nullable<T> Coalesce(
	Nullable<T> objectProperty, 
	T replaceValueIfIsNull
)

Parameters

objectProperty
Type: System..::..Nullable<(Of <(<'T>)>)>

[Missing <param name="objectProperty"/> documentation for "M:NHibernate.Criterion.ProjectionsExtensions.Coalesce``1(System.Nullable{``0},``0)"]

replaceValueIfIsNull
Type: T

[Missing <param name="replaceValueIfIsNull"/> documentation for "M:NHibernate.Criterion.ProjectionsExtensions.Coalesce``1(System.Nullable{``0},``0)"]

Type Parameters

T

[Missing <typeparam name="T"/> documentation for "M:NHibernate.Criterion.ProjectionsExtensions.Coalesce``1(System.Nullable{``0},``0)"]

Return Value

[Missing <returns> documentation for "M:NHibernate.Criterion.ProjectionsExtensions.Coalesce``1(System.Nullable{``0},``0)"]

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Nullable<(Of <(<'T>)>)>. When you use instance method syntax to call this method, omit the first parameter. For more information, see or .

See Also