Return the persistent instance of the given entity class with the given identifier, assuming that the instance exists.

Namespace:  NHibernate
Assembly:  NHibernate (in NHibernate.dll)

Syntax

Visual Basic (Declaration)
Function Load ( _
	theType As Type, _
	id As Object _
) As Object
C#
Object Load(
	Type theType,
	Object id
)
Visual C++
Object^ Load(
	Type^ theType, 
	Object^ id
)
JavaScript
function load(theType, id);

Parameters

theType
Type: System..::.Type
A persistent class
id
Type: System..::.Object
A valid identifier of an existing persistent instance of the class

Return Value

The persistent instance or proxy

Remarks

You should not use this method to determine if an instance exists (use a query or Get(Type, Object) instead). Use this only to retrieve an instance that you assume exists, where non-existence would be an actual error.

See Also