Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SaveChangesAsync() doc page #25

Open
ajcvickers opened this issue Jul 30, 2018 · 4 comments
Open

SaveChangesAsync() doc page #25

ajcvickers opened this issue Jul 30, 2018 · 4 comments

Comments

@ajcvickers
Copy link
Member

Moved from dotnet/efcore#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:

image

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

@ajcvickers
Copy link
Member Author

@divega
Copy link
Contributor

divega commented Aug 2, 2018

@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

@mairaw
Copy link
Contributor

mairaw commented Aug 2, 2018

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

@terrajobst
Copy link
Member

terrajobst commented Aug 2, 2018

Our index hasn't been updated in a while (see below). We need to make some infrastructure changes and that's coming online later.
image
So it's possible that apisof.net is out-of-date. Not sure why that problem would apply to the docs though...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants