Share via


Database.SaveChangesAsync Method

Definition

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 abstract System.Threading.Tasks.Task<int> SaveChangesAsync (System.Collections.Generic.IList<Microsoft.EntityFrameworkCore.Update.IUpdateEntry> entries, System.Threading.CancellationToken cancellationToken = default);
abstract member SaveChangesAsync : System.Collections.Generic.IList<Microsoft.EntityFrameworkCore.Update.IUpdateEntry> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<int>
Public MustOverride 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.

Implements

Exceptions

Applies to

SaveChangesAsync(IReadOnlyList<IUpdateEntry>, CancellationToken)

Asynchronously persists changes from the supplied entries to the database.

public abstract System.Threading.Tasks.Task<int> SaveChangesAsync (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Update.IUpdateEntry> entries, System.Threading.CancellationToken cancellationToken = default);
abstract member SaveChangesAsync : System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Update.IUpdateEntry> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<int>
Public MustOverride 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.

Implements

Applies to