dotnet / dotnet/EntityFramework.ApiDocs

SaveChangesAsync() doc page

Open
#25 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
17
Forks
49
PR merge metrics
No merged PRs in 30d

Description

Moved from https://github.com/aspnet/EntityFrameworkCore/issues/12751 posted by @erictrigo

Check out: https://docs.microsoft.com/en-us/dotnet/api/microsoft.entityframeworkcore.dbcontext.savechangesasync?view=efcore-2.1

Says signature for SaveChangesAsync is

`public virtual System.Threading.Tasks.Task SaveChangesAsync (System.Threading.CancellationToken cancellationToken = null);`

If you try overriding SaveChangesAsync using the above example, it'll give you the following error:

![image](https://user-images.githubusercontent.com/14839910/43035677-92c77984-8cf4-11e8-9318-2aac3e55e7af.png)

Using `default(CancellationToken)` instead of `null` solves the issue:
`public override async Task SaveChangesAsync(CancellationToken cancellationToken = default(CancellationToken))`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.