Database.AddAsync Method
Recursively executes INSERT commands for the specified entity and all its one-to-one and one-to-many associations.
Namespace: DbExtensions
Assembly: DbExtensions.dll
Syntax
public ValueTask AddAsync(
Object entity,
CancellationToken cancellationToken = default
)
Parameters
entity Object
The object whose INSERT command is to be executed. This parameter is named entity for consistency with the other CRUD methods, but in this case it doesn’t need to be an actual entity, which means it doesn’t need to have a primary key.
cancellationToken CancellationToken (Optional)
The CancellationToken to monitor for cancellation requests. The default is None.
Return Value
Remarks
This method is a shortcut for await db.Table(entity.GetType()).AddAsync(entity, cancellationToken)
.
See Also
Reference
Database Class
DbExtensions Namespace
SqlTable.AddAsync(Object, CancellationToken)