Load an instance by a unique key that is not the primary key.

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

Syntax

C#
public Object LoadByUniqueKey(
	string entityName,
	string uniqueKeyPropertyName,
	Object key,
	ISessionImplementor session
)
Visual Basic
Public Function LoadByUniqueKey ( _
	entityName As String, _
	uniqueKeyPropertyName As String, _
	key As Object, _
	session As ISessionImplementor _
) As Object
Visual C++
public:
Object^ LoadByUniqueKey(
	String^ entityName, 
	String^ uniqueKeyPropertyName, 
	Object^ key, 
	ISessionImplementor^ session
)

Parameters

entityName
Type: System..::..String
The name of the entity to load
uniqueKeyPropertyName
Type: System..::..String
The name of the property defining the uniqie key.
key
Type: System..::..Object
The unique key property value.
session
Type: NHibernate.Engine..::..ISessionImplementor
The originating session.

Return Value

The loaded entity

See Also