Database.Find(Type, Object) Method
Gets the entity whose primary key matches the id parameter.
Namespace: DbExtensions
Assembly: DbExtensions.dll
Overloads
Name | Description | |
---|---|---|
Find(Type, Object) | Gets the entity whose primary key matches the id parameter. | |
Find<TEntity>(Object) | Gets the entity whose primary key matches the id parameter. |
Syntax
public Object Find(
Type entityType,
Object id
)
Parameters
entityType Type
The type of the entity.
id Object
The primary key value.
Return Value
Object
The entity whose primary key matches the id parameter, or null if the id does not exist.
Remarks
This method is a shortcut for db.Table(entityType).Find(id)
.