From 984168dca203ac226b72c75b3d1283f4756ea84b Mon Sep 17 00:00:00 2001 From: Jose Arriaga Maldonado <45773732+joseharriaga@users.noreply.github.com> Date: Sun, 21 Jul 2024 22:39:19 -0700 Subject: [PATCH] Update generated code (3.0.0-beta.20240711.1) (#127) --- src/Generated/Internal/BinaryContentHelper.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Generated/Internal/BinaryContentHelper.cs b/src/Generated/Internal/BinaryContentHelper.cs index 5ebcd95b..52bcdbdf 100644 --- a/src/Generated/Internal/BinaryContentHelper.cs +++ b/src/Generated/Internal/BinaryContentHelper.cs @@ -52,6 +52,20 @@ public static BinaryContent FromEnumerable(IEnumerable enumerable) return content; } + public static BinaryContent FromEnumerable(ReadOnlySpan span) + where T : notnull + { + Utf8JsonBinaryContent content = new Utf8JsonBinaryContent(); + content.JsonWriter.WriteStartArray(); + for (int i = 0; i < span.Length; i++) + { + content.JsonWriter.WriteObjectValue(span[i], ModelSerializationExtensions.WireOptions); + } + content.JsonWriter.WriteEndArray(); + + return content; + } + public static BinaryContent FromDictionary(IDictionary dictionary) where TValue : notnull {