-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
ClientModel: Release Azure.Variant
in the Azure.Core package
#32978
Comments
Do we have any other context on the |
@KrzysztofCwalina and @tg-msft asked me to consider using it for an upcoming KV release, but seems it won't make it in time. They asked me to open a tracking issue. |
Per @KrzysztofCwalina:
|
Filling in some context:
|
Maybe |
A service team has asked how they can indicate in a swagger or typespec file that Value should be used in a model - it would be good to provide a solution to this. |
Azure.Value
in the Azure.Core packageAzure.Variant
in the Azure.Core package
Azure.Variant
in the Azure.Core packageAzure.Variant
in the Azure.Core package
@KrzysztofCwalina, we should touch-base on whether or not this is currently a priority, and if so, what our approach is now given System.ClientModel |
Feature Description
Azure.Variant
is an implementation of a tagged union. It provides a type we can use for both primitives and value types to avoid boxing .NET intrinsic types. For example, in libraries like KeyVault mentioned below, it could be used to hold both a string and an int without boxing the int.API Proposal
dotnet/runtime#28882
Additions we'd like to make
As<T>
without throwingThe following code should print "System.String", but it prints "Azure.Value":
If a cast from S to D works in standard C# code, it should work when S is stored in Variant.
Libraries we expect to use it
The text was updated successfully, but these errors were encountered: