IEntityDeleteAsync Method (IPredicate, CancellationToken) |
Async variant of
Delete(IPredicate).
Deletes the Entity from the persistent storage. This method succeeds also when the Entity is not present.
Namespace:
SD.LLBLGen.Pro.ORMSupportClasses
Assembly:
SD.LLBLGen.Pro.ORMSupportClasses (in SD.LLBLGen.Pro.ORMSupportClasses.dll) Version: 5.2.0.0 (5.2.17.0403)
Syntax Task<bool> DeleteAsync(
IPredicate deleteRestriction,
CancellationToken cancellationToken
)
Function DeleteAsync (
deleteRestriction As IPredicate,
cancellationToken As CancellationToken
) As Task(Of Boolean)
Parameters
- deleteRestriction
- Type: SD.LLBLGen.Pro.ORMSupportClassesIPredicate
Predicate expression, meant for concurrency checks in a delete query. Overrules the predicate returned
by a set ConcurrencyPredicateFactory object. - cancellationToken
- Type: System.ThreadingCancellationToken
The cancellation token.
Return Value
Type:
TaskBoolean
true if Delete succeeded, false otherwise
Exceptions Exception | Condition |
---|
ORMConcurrencyException | The delete action of an entity failed, probably due to the set delete restriction provided. The entity which failed is enclosed. |
ORMQueryExecutionException | When an exception is caught during the delete process. The caught exception is set as the
inner exception. Encapsulation of database-related exceptions is necessary since these exceptions do not have a common exception framework
implemented. |
See Also