Table(Of TEntity).DeleteOnSubmit Method
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Puts an entity from this table into a pending delete state.
Assembly: System.Data.Linq (in System.Data.Linq.dll)
Parameters
- entity
- Type: TEntity
The entity to be deleted.
Implements
ITable(Of TEntity).DeleteOnSubmit(TEntity)The removed entity does not disappear from the query results until after SubmitChanges is called. Disconnected entities must first be attached before they can be deleted.
Note: |
|---|
LINQ to SQL does not support or recognize cascade-delete operations. If you want to delete a row in a table that has constraints against it, you must either set the ON DELETE CASCADE rule in the foreign-key constraint in the database, or use your own code to first delete the child objects that prevent the parent object from being deleted. Otherwise, an exception is thrown. |
Note: