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

WIP Add support for BeginTransactionAsync #3139

Open
wants to merge 32 commits into
base: master
Choose a base branch
from

Conversation

hazzik
Copy link
Member

@hazzik hazzik commented Aug 29, 2022

No description provided.

@hazzik hazzik closed this Aug 29, 2022
@hazzik hazzik reopened this Sep 1, 2022
@hazzik hazzik closed this Sep 1, 2022
@hazzik hazzik reopened this Sep 1, 2022
{
if (isolationLevel == IsolationLevel.Unspecified)
{
return connection.BeginTransactionAsync(cancellationToken);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maca88 I tried to fix this by using 'alwaysAwait' option, but I could not quite figure out the syntax.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To fix this change the alwaysAwait section to:

alwaysAwait:
    - name: BeginTransaction

The filter BeginTransactionAsync could also work but the containingTypeName filter would need to be changed from AsyncExtensions to DriverBase.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does it work? I thought it identifies the method that should be always awaited.

Copy link
Contributor

@maca88 maca88 Sep 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With alwaysAwait you define filters that are applied on every generated async method to check whether to force await invocations inside the method body. So if we take the above filter as an example, every generated async method that has a sync counterpart named BeginTransaction will be generated by using async/await even if some of them could be generated without it.

src/AsyncGenerator.yml Outdated Show resolved Hide resolved
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

Successfully merging this pull request may close these issues.

2 participants