Database.ContainsKey Method (Type, Object)
Checks the existance of an entity whose primary matches the id parameter.
Namespace: DbExtensions
Assembly: DbExtensions.dll
Syntax
public bool ContainsKey(
Type entityType,
Object id
)
Parameters
entityType
Type: System.Type
The type of the entity.
id
Type: System.Object
The primary key value.
Return Value
Type: Boolean
true if the primary key value exists in the database; otherwise false.
Remarks
This method is a shortcut for db.Table(entityType).ContainsKey(id)
.
See Also
Reference
Database Class
DbExtensions Namespace
SqlSet.ContainsKey(Object)