diff --git a/sdk/core/Azure.Core.Experimental/CHANGELOG.md b/sdk/core/Azure.Core.Experimental/CHANGELOG.md index 695edaf678cf..0858af1a111d 100644 --- a/sdk/core/Azure.Core.Experimental/CHANGELOG.md +++ b/sdk/core/Azure.Core.Experimental/CHANGELOG.md @@ -1,5 +1,10 @@ # Release History +## 0.1.0-preview.6 (Unreleased) + +### Breaking Changes +- `BinaryData`: Change return type of `FromObjectAsync` from `Task` to `ValueTask` + ## 0.1.0-preview.5 (2020-09-03) ### Added diff --git a/sdk/core/Azure.Core.Experimental/api/Azure.Core.Experimental.netstandard2.0.cs b/sdk/core/Azure.Core.Experimental/api/Azure.Core.Experimental.netstandard2.0.cs index 0357c48485fe..560625d318f0 100644 --- a/sdk/core/Azure.Core.Experimental/api/Azure.Core.Experimental.netstandard2.0.cs +++ b/sdk/core/Azure.Core.Experimental/api/Azure.Core.Experimental.netstandard2.0.cs @@ -16,8 +16,8 @@ public readonly partial struct BinaryData public static Azure.BinaryData FromBytes(byte[] data) { throw null; } public static Azure.BinaryData FromBytes(System.ReadOnlyMemory data) { throw null; } public static Azure.BinaryData FromBytes(System.ReadOnlySpan data) { throw null; } - public static System.Threading.Tasks.Task FromObjectAsync(T serializable, Azure.Core.Serialization.ObjectSerializer serializer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static System.Threading.Tasks.Task FromObjectAsync(T jsonSerializable, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.ValueTask FromObjectAsync(T serializable, Azure.Core.Serialization.ObjectSerializer serializer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.ValueTask FromObjectAsync(T jsonSerializable, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.BinaryData FromObject(T serializable, Azure.Core.Serialization.ObjectSerializer serializer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.BinaryData FromObject(T jsonSerializable, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.BinaryData FromStream(System.IO.Stream stream) { throw null; } diff --git a/sdk/core/Azure.Core.Experimental/src/Primitives/BinaryData.cs b/sdk/core/Azure.Core.Experimental/src/Primitives/BinaryData.cs index 117c68c08128..d92ca6b6afde 100644 --- a/sdk/core/Azure.Core.Experimental/src/Primitives/BinaryData.cs +++ b/sdk/core/Azure.Core.Experimental/src/Primitives/BinaryData.cs @@ -231,7 +231,7 @@ public static BinaryData FromObject( /// The to use during serialization. /// /// A instance. - public static async Task FromObjectAsync( + public static async ValueTask FromObjectAsync( T jsonSerializable, CancellationToken cancellationToken = default) => await FromObjectInternalAsync(jsonSerializable, s_jsonSerializer, true, cancellationToken).ConfigureAwait(false); @@ -266,13 +266,13 @@ public static BinaryData FromObject( /// /// The to use during serialization. /// A instance. - public static async Task FromObjectAsync( + public static async ValueTask FromObjectAsync( T serializable, ObjectSerializer serializer, CancellationToken cancellationToken = default) => await FromObjectInternalAsync(serializable, serializer, true, cancellationToken).ConfigureAwait(false); - private static async Task FromObjectInternalAsync( + private static async ValueTask FromObjectInternalAsync( T data, ObjectSerializer serializer, bool async,