NPersistence Reference Guide
Find by primary key, using the specified properties. 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. If a vendor-specific property or hint is not recognized, it is silently ignored.

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,
	Dictionary<string, Object> properties
)

Parameters

entityClass
Type
entity class
primaryKey
Object
primary key
properties
Dictionary<(Of <(<'String, Object>)>)>
standard and vendor-specific properties and hints

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