-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Added Value (variant) Type #27487
Added Value (variant) Type #27487
Conversation
This pull request is protected by Check Enforcer. |
API changes have been detected in |
sdk/core/Azure.Core.Experimental/api/Azure.Core.Experimental.netstandard2.0.cs
Show resolved
Hide resolved
sdk/core/Azure.Core.Experimental/api/Azure.Core.Experimental.netstandard2.0.cs
Show resolved
Hide resolved
Is there a sample showing how we would use it this way in an Azure SDK context? |
@annelo-msft, this is how it's used today in one of the track 2 libraries: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/timeseriesinsights/Azure.IoT.TimeSeriesInsights/src/Models/TimeSeriesValue.cs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might make sense to add a few docstrings for key APIs on Value. Also, I defer to you on whether we have concerns about calls to Unsafe
.
sdk/core/Azure.Core.Experimental/tests/Variant/StoringArrays.cs
Outdated
Show resolved
Hide resolved
sdk/core/Azure.Core.Experimental/api/Azure.Core.Experimental.netstandard2.0.cs
Show resolved
Hide resolved
sdk/core/Azure.Core.Experimental/src/Variant/Value.PackedDateTimeOffset.cs
Show resolved
Hide resolved
FYI: I remembered why I didn't store Possible options when you need to store a given type with no value:
|
From time to time we run into cases where we want to store a heterogenous collection of values. This type allows to store such values while minimizing boxing. The type was developed by @JeremyKuhne. The original idea was that this type ends up in the BCL, but the idea was rejected.
Here is an example of a very similar type in a track2 library: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/timeseriesinsights/Azure.IoT.TimeSeriesInsights/src/Models/TimeSeriesValue.cs