Delete an object from the database by the primary key
The object must have a primary key property of Id or ObjectNameId as a type of long or an exception will be thrown.
Example primary key: CustomerId
Public Overloads Function Delete(Of As {Class, New})( _
ByVal As Long _
) As Integer
Dim instance As NinjaDbPro
Dim primaryKey As Long
Dim value As Integer
value = instance.Delete(Of T)(primaryKey)
public int Delete<>(
long
)
where T: class, new()
public:
int Deletegeneric<typename >
(
int64
)
where T: ref class, gcnew()
Parameters
- primaryKey
Type Parameters
- T
Return Value
The number of items deleted
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2