EntityFramework.ApiDocs
EntityFramework.ApiDocs copied to clipboard
SaveChangesAsync() doc page
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<int> SaveChangesAsync (System.Threading.CancellationToken cancellationToken = null);
If you try overriding SaveChangesAsync using the above example, it'll give you the following error:

Using default(CancellationToken) instead of null solves the issue:
public override async Task<int> SaveChangesAsync(CancellationToken cancellationToken = default(CancellationToken))
From @smitpatel
Looks like issue in docs gen https://github.com/aspnet/EntityFrameworkCore/blob/df9d2ccb47614b014c11903ed0eb8c9830da1d2c/src/EFCore/DbContext.cs#L491-L492
cc:@divega
@dend do you know if this is a general issue with the way the cancellationToken = default pattern gets rendered when the API ref docs are generated?
BTW, I tried to verify if this was happening on other APIs but all the new 2.1 APIs that happen to use this pattern seem to be missing from the .NET API Browser. E.g. https://docs.microsoft.com/en-us/dotnet/api/system.io.compression.gzipstream.writeasync?view=netcore-2.1 is missing this overload:
public override ValueTask WriteAsync(ReadOnlyMemory<byte> buffer, CancellationToken cancellationToken = default(CancellationToken))
{ }
cc: @mairaw
I see the same behavior on apisof.net (/cc @terrajobst) https://apisof.net/catalog/System.IO.Compression.GZipStream.WriteAsync(Byte(),Int32,Int32,CancellationToken)
Not sure if you can infer the default from reflection to be able to build the signature exactly (can't look right now)
Probably it would be best to open an issue at https://github.com/mono/api-doc-tools/ for @joelmartinez to investigate
Our index hasn't been updated in a while (see below). We need to make some infrastructure changes and that's coming online later.
So it's possible that apisof.net is out-of-date. Not sure why that problem would apply to the docs though...