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
[FEATURE REQ] KeyVaultKeyIdentifier.TryParse #23146
Comments
Thank you for your feedback. Tagging and routing to the team member best able to assist. |
@KrzysztofCwalina customers here are asking for my original design. Do you see any problem adding this? The |
Hi @heaths, any update on whether this API will be added to the next stable release? |
I am not totally opposed to digging deeper here and possibly solving a problem, but: It's not really parsing. The URI is already parsed when it's passed to the ctor. The issue seems to be that some users (e.g. @jimmyca15) do not like exceptions for invalid arguments. I totally understand issues with C# exception handling (I am myself not a big fan), and I talked with the C# team many times about it, but don't think TryParse was intended for that. In .NET, we throw exceptions for invalid arguments. .NET guidelines specifically state that Try methods should not be added because we don't like exceptions. Try methods are performance optimizations, and so if you add them you need to show that performance is a problem (not in microbenchmarks). If we started to add Try methods to all places where we don't like exceptions, we would end up with every BCL API duplicated (try and non-try variants). @MadsTorgersen, @jaredpar, if would be nice to have try expressions in the language, just like we planned in M# :-) see "int value1 = try Foo() else 42;" @ http://joeduffyblog.com/2016/02/07/the-error-model/ |
The URI is not parsed. It is a URI, yes, but not necessarily a valid Key Vault URI. That's why I had
The point of this struct was to parse a URI as a valid Key Vault (or Managed HSM) URI. I agree that we need a |
We will add a |
* Add TryCreate to Identifier structures Fixes #23146 * Resolve feedback
Edit description of properties.provisioningState (Azure#23146)
Library or service name.
Azure.Security.KeyVault.Keys
Is your feature request related to a problem? Please describe.
If I develop an application that takes user input that should be a key vault key URI I have to write the following code to validate it is a Key Vault URI.
Ideally I would like to write
The text was updated successfully, but these errors were encountered: