From 8a572b7669e5162bf04737f81e36fb26641ea43b Mon Sep 17 00:00:00 2001 From: Joshua Harms Date: Tue, 31 Dec 2024 16:45:00 -0600 Subject: [PATCH] Return a MemoryStream for better performance --- .../Infrastructure/Serialization/Json/SystemJsonSerializer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShopifySharp/Infrastructure/Serialization/Json/SystemJsonSerializer.cs b/ShopifySharp/Infrastructure/Serialization/Json/SystemJsonSerializer.cs index 545ed2a57..0755d1284 100644 --- a/ShopifySharp/Infrastructure/Serialization/Json/SystemJsonSerializer.cs +++ b/ShopifySharp/Infrastructure/Serialization/Json/SystemJsonSerializer.cs @@ -13,7 +13,7 @@ internal class SystemJsonSerializer(JsonSerializerOptions options) : IJsonSerial private static SystemJsonElement Guard(IJsonElement element) => element as SystemJsonElement ?? throw new ArgumentException($"Expected a {nameof(SystemJsonElement)} but got {element.GetType().FullName}.", nameof(element)); - private static Stream ToStream(IJsonElement value) + private static MemoryStream ToStream(IJsonElement value) { var element = Guard(value).GetRawObject(); var memoryStream = new MemoryStream();