Provide mechanism for checking if custom column encryption provider has been registered
- Dominant language
- C#
- Stars
- 989
- Forks
- 340
- Avg merge
- 4d 18h
- Merged PRs (30d)
- 69
Description
### Is your feature request related to a problem? Please describe.
We make use of the `SqlColumnEncryptionAzureKeyVaultProvider` which we register as part of our host configuration. For integration testing altering the client, configuration causes a `System.InvalidOperationException` to be thrown if a second attempt is made to register the same provider. Currently, we are catching this specific instance and ignoring the exception.
### Describe the solution you'd like
Ideally having a mechanism to check if the provider has been registered would help us decide if the registration should be done again.
### Describe alternatives you've considered
I don't really know if there is another more appropriate alternative as we don't want to alter the current functionality.
### Additional context
[The exception is thrown here](https://github.com/dotnet/SqlClient/blob/d600f8921e193c72b37d728b8a76cee2cfece9ac/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlConnection.cs#L311)
Contributor guide
Assessment
This issue has not been assessed yet.