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
Support for BeginTransactionAsync #3052
base: master
Are you sure you want to change the base?
Conversation
… #if to as BeginTransactionAsync only exists since NET Standard 2.1
…DARD2_1_OR_GREATER
|
||
#if NETSTANDARD2_1_OR_GREATER | ||
public async Task<ITransaction> BeginTransactionAsync(IsolationLevel isolationLevel) | ||
{ | ||
EnsureTransactionIsCreated(); | ||
await _transaction.BeginAsync(isolationLevel).ConfigureAwait(false); | ||
return _transaction; | ||
} | ||
|
||
public async Task<ITransaction> BeginTransactionAsync() | ||
{ | ||
EnsureTransactionIsCreated(); | ||
await _transaction.BeginAsync().ConfigureAwait(false); | ||
return _transaction; | ||
} | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No manual editing of generated code files (see their header) can be allowed.
Almost all the "coding" for async happens in the AsyncGenerator yaml file. To diagnose why it does not generate a BeginTransactionAsync by itself, run the aync generator (see contributing.md) and analyze its output.
Either we have disabled it for this member on purpose (then look in git history from where it comes to find the rational) or it may not actually trigger a connection opening as you seem to assume. (I have not checked anything.) Maybe some other cause is in play, like an async candidate access triggered by a property access, case which cannot be converted to async. Such cases will de diagnosed in the async generator output.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why it does not generate a BeginTransactionAsync by itself
Two reasons:
- The target generation is set to netstandard2.0
- The return type is
ValueTask<>
that is yet not supported by AsyncGenerator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't notice these files were autogenerated :-(
Resolves: #3051
Todo: