public string Get(object parameter) { var stream = _stream(); using (var writer = _factory.Get(stream)) { _serializer.Serialize(writer, parameter); writer.Flush(); stream.Seek(0, SeekOrigin.Begin); var result = new StreamReader(stream).ReadToEnd(); return(result); } }
static void Serialize(this IExtendedXmlSerializer @this, IXmlWriterFactory factory, TextWriter writer, object instance) => @this.Serialize(factory.Get(writer), instance);