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: NPersistenceAssembly: NPersistence (in NPersistence.dll) Version: 2.0.0.0 (2.0.0.0)
Syntax
T Find<T>(
Type entityClass,
Object primaryKey
)
Parameters
- entityClass
- Type
entity class
- primaryKey
- Object
primary key
Type Parameters
Return Value
the found entity instance or null if the entity does
not exist
Exceptions
Exception | Condition |
---|
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