snowflake-connector-net icon indicating copy to clipboard operation
snowflake-connector-net copied to clipboard

Adding support for CloseAsync() on IDbConnection in .NET 6

Open aschwenker-insight opened this issue 2 years ago • 3 comments

IDbConnection in .NET Standard 2.1 added a new CloseAsync() method.

This Pull Request adds functionality targeted at .NET Standard 2.1 (designated by the NETCOREAPP3_0_OR_GREATER compiler flag) to add an override for CloseAsync(). The compiler flag is required because the codebase also targets .NET Framework 4.7.2, which only supports .NET Standard 2.0 that doesn't have CloseAsync().

This Pull Request negates the need to cast to SnowflakeDbConnection to call CloseAsync(CancellationToken) in .NET 6 by having CloseAsync() call CloseAsync(CancellationToken.None).

aschwenker-insight avatar Oct 21 '22 14:10 aschwenker-insight

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

github-actions[bot] avatar Oct 21 '22 14:10 github-actions[bot]

I have read the CLA Document and I hereby sign the CLA

aschwenker-insight avatar Oct 21 '22 14:10 aschwenker-insight

recheck

aschwenker-insight avatar Oct 21 '22 14:10 aschwenker-insight

@aschwenker-insight, is this PR associated with any issue within this repo? If not, could you please create the issue and mention the PR there?

sfc-gh-pbulawa avatar Aug 30 '23 09:08 sfc-gh-pbulawa

Thanks! Could you please write a test for that method? I think it could be based on SFConnectionIT.TestCloseAsync() test

sfc-gh-pbulawa avatar Aug 31 '23 15:08 sfc-gh-pbulawa