NPersistence Reference Guide
Find by primary key. Search for an entity of the specified class and primary key. If the entity instance is contained in the persistence context, it is returned from there.

Namespace: NPersistence
Assembly: NPersistence (in NPersistence.dll) Version: 2.0.0.0 (2.0.0.0)

Syntax

   
 C# 
T Find<T>(
	Type entityClass,
	Object primaryKey
)

Parameters

entityClass
Type
entity class
primaryKey
Object
primary key

Type Parameters

T

Return Value

the found entity instance or null if the entity does not exist

Exceptions

ExceptionCondition
System..::..ArgumentException if the first argument does not denote an entity type or the second argument is is not a valid type for that entity’s primary key or is null

See Also