Finds an object instance by its primary key.

Namespace: Castle.ActiveRecord
Assembly:  Castle.ActiveRecord (in Castle.ActiveRecord.dll)
Version: 1.0.3.0

Syntax

C#
public static Object FindByPrimaryKey(
	Type targetType,
	Object id,
	bool throwOnNotFound
)

Parameters

targetType
Type
The AR subclass type
id
Object
ID value
throwOnNotFound
Boolean
true if you want an exception to be thrown if the object is not found

Exceptions

ExceptionCondition
ObjectNotFoundExceptionif throwOnNotFound is set to true and the row is not found

See Also