Click or drag to resize
IDataAccessAdapterSaveEntityAsync Method (IEntity2, Boolean, IPredicateExpression, Boolean, CancellationToken)
Async variant of SaveEntity(IEntity2, Boolean, IPredicateExpression, Boolean). Saves the passed in entity to the persistent storage. If the entity is new, it will be inserted, if the entity is existent, the changed entity fields will be changed in the database.

Namespace:  SD.LLBLGen.Pro.ORMSupportClasses
Assembly:  SD.LLBLGen.Pro.ORMSupportClasses (in SD.LLBLGen.Pro.ORMSupportClasses.dll) Version: (5.3.0)
Task<bool> SaveEntityAsync(
	IEntity2 entityToSave,
	bool refetchAfterSave,
	IPredicateExpression updateRestriction,
	bool recurse,
	CancellationToken cancellationToken


Type: SD.LLBLGen.Pro.ORMSupportClassesIEntity2
The entity to save
Type: SystemBoolean
When true, it will refetch the entity from the persistent storage so it will be up-to-date after the save action.
Type: SD.LLBLGen.Pro.ORMSupportClassesIPredicateExpression
Predicate expression, meant for concurrency checks in an Update query. Will be ignored if the entity is new. This predicate is used instead of a predicate produced by a set ConcurrencyPredicateFactory.
Type: SystemBoolean
When true, it will save all dirty objects referenced (directly or indirectly) by entityToSave also.
Type: System.ThreadingCancellationToken
The cancellation token.

Return Value

Type: TaskBoolean
true if the save was succesful, false otherwise.
Will use a current transaction if a transaction is in progress
See Also