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

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

Syntax

C#
Object Load(
	string entityName,
	Object id
)
Visual Basic
Function Load ( _
	entityName As String, _
	id As Object _
) As Object
Visual C++
Object^ Load(
	String^ entityName, 
	Object^ id
)

Parameters

entityName
Type: System..::..String
The entity-name of 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 Get(String, Object) instead). Use this only to retrieve an instance that you assume exists, where non-existence would be an actual error.

See Also