RelationalDatabase.SaveChangesAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
SaveChangesAsync(IList<IUpdateEntry>, CancellationToken) |
Asynchronously persists changes from the supplied entries to the database. |
SaveChangesAsync(IReadOnlyList<IUpdateEntry>, CancellationToken) |
Asynchronously persists changes from the supplied entries to the database. |
SaveChangesAsync(IList<IUpdateEntry>, CancellationToken)
Asynchronously persists changes from the supplied entries to the database.
public override System.Threading.Tasks.Task<int> SaveChangesAsync (System.Collections.Generic.IList<Microsoft.EntityFrameworkCore.Update.IUpdateEntry> entries, System.Threading.CancellationToken cancellationToken = default);
override this.SaveChangesAsync : System.Collections.Generic.IList<Microsoft.EntityFrameworkCore.Update.IUpdateEntry> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<int>
Public Overrides Function SaveChangesAsync (entries As IList(Of IUpdateEntry), Optional cancellationToken As CancellationToken = Nothing) As Task(Of Integer)
Parameters
- entries
- IList<IUpdateEntry>
Entries representing the changes to be persisted.
- cancellationToken
- CancellationToken
A CancellationToken to observe while waiting for the task to complete.
Returns
A task that represents the asynchronous save operation. The task result contains the number of entries persisted to the database.
Exceptions
If the CancellationToken is canceled.
Applies to
SaveChangesAsync(IReadOnlyList<IUpdateEntry>, CancellationToken)
Asynchronously persists changes from the supplied entries to the database.
public override System.Threading.Tasks.Task<int> SaveChangesAsync (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Update.IUpdateEntry> entries, System.Threading.CancellationToken cancellationToken = default);
override this.SaveChangesAsync : System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Update.IUpdateEntry> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<int>
Public Overrides Function SaveChangesAsync (entries As IReadOnlyList(Of IUpdateEntry), Optional cancellationToken As CancellationToken = Nothing) As Task(Of Integer)
Parameters
- entries
- IReadOnlyList<IUpdateEntry>
Entries representing the changes to be persisted.
- cancellationToken
- CancellationToken
A CancellationToken to observe while waiting for the task to complete.
Returns
A task that represents the asynchronous save operation. The task result contains the number of entries persisted to the database.
Applies to
Entity Framework