diff --git a/src/Elasticsearch.Net/Serialization/ElasticsearchSerializerExtensions.cs b/src/Elasticsearch.Net/Serialization/ElasticsearchSerializerExtensions.cs index 1948f5b43a2..6d86b0b0cb4 100644 --- a/src/Elasticsearch.Net/Serialization/ElasticsearchSerializerExtensions.cs +++ b/src/Elasticsearch.Net/Serialization/ElasticsearchSerializerExtensions.cs @@ -8,7 +8,13 @@ public static class ElasticsearchSerializerExtensions public static byte[] SerializeToBytes( this IElasticsearchSerializer serializer, T data, - IMemoryStreamFactory memoryStreamFactory = null, + SerializationFormatting formatting = SerializationFormatting.Indented) => + SerializeToBytes(serializer, data, RecyclableMemoryStreamFactory.Default, formatting); + + public static byte[] SerializeToBytes( + this IElasticsearchSerializer serializer, + T data, + IMemoryStreamFactory memoryStreamFactory, SerializationFormatting formatting = SerializationFormatting.Indented ) { @@ -23,7 +29,13 @@ public static byte[] SerializeToBytes( public static string SerializeToString( this IElasticsearchSerializer serializer, T data, - IMemoryStreamFactory memoryStreamFactory = null, + SerializationFormatting formatting = SerializationFormatting.Indented) => + SerializeToString(serializer, data, RecyclableMemoryStreamFactory.Default, formatting); + + public static string SerializeToString( + this IElasticsearchSerializer serializer, + T data, + IMemoryStreamFactory memoryStreamFactory, SerializationFormatting formatting = SerializationFormatting.Indented ) { @@ -34,7 +46,5 @@ public static string SerializeToString( return ms.Utf8String(); } } - - } }