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

Add ExecuteReaderAsync overloads that return Task<DbDataReader> #1295

Merged
merged 1 commit into from
Aug 27, 2019

Conversation

jnm2
Copy link
Contributor

@jnm2 jnm2 commented Jul 12, 2019

Closes #1140

In order to avoid a binary breaking change, new overloads must be added rather than changing the return type of the existing methods.

This causes a potential source-breaking change because the new DbConnection overloads will take precedence over the existing IDbConnection overloads when users recompile their projects:

// CS0029: Cannot implicitly convert type
// 'System.Threading.Tasks.Task<System.Data.Common.DbDataReader>'
// to 'System.Threading.Tasks.Task<System.Data.IDataReader>'

Task<IDbDataReader> readerTask = dbConnection.ExecuteReaderAsync(...);

// Or

Foo(dbConnection.ExecuteReaderAsync(...));

void Foo(Task<IDbDataReader> readerTask)
{
    // ...
}

/cc @mgravell

@mgravell
Copy link
Member

looks good, thanks; merging

@mgravell mgravell merged commit 6754fe2 into DapperLib:master Aug 27, 2019
@jnm2 jnm2 deleted the dbdatareader branch August 27, 2019 18:24
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.

Connection.ExecuteReaderAsync returns IDataReader which has no ReadAsync
2 participants