diff --git a/src/Generated/Internal/BinaryContentHelper.cs b/src/Generated/Internal/BinaryContentHelper.cs index 5ebcd95b2..52bcdbdf3 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 {