source/SchemaValidation/source/SchemaValidation/Extensions/SchemaValidatingReaderErrorExtensions.cs
/// <summary>
/// Writes the specified error response into the destination stream as XML.
/// </summary>
/// <param name="errorResponse">The error response to write.</param>
/// <param name="destination">The stream to write the response into.</param>
Writes the specified error response into the destination stream as XML.
Writes the specified error response into the destination stream as XML .
public static async Task WriteAsXmlAsync(this ErrorResponse errorResponse, Stream destination)
        {
            var xmlWriterSettings = new XmlWriterSettings
            {
                Async = true,
                Encoding = Encoding.UTF8,
                Indent = true,
            };
            await using var xmlWriter = XmlWriter.Create(destination, xmlWriterSettings);
            await xmlWriter.WriteStartDocumentAsync().ConfigureAwait(false);
            await errorResponse.WriteXmlContentsAsync(xmlWriter).ConfigureAwait(false);
            await xmlWriter.WriteEndDocumentAsync().ConfigureAwait(false);
            await xmlWriter.FlushAsync().ConfigureAwait(false);
        }
public static async Task WriteAsXmlAsync ( this ErrorResponse errorResponse , Stream destination ) { var xmlWriterSettings = new XmlWriterSettings { Async = true , Encoding = Encoding . UTF8 , Indent = true , } ; await using var xmlWriter = XmlWriter . Create ( destination , xmlWriterSettings ) ; await xmlWriter . WriteStartDocumentAsync ( ) . ConfigureAwait ( false ) ; await errorResponse . WriteXmlContentsAsync ( xmlWriter ) . ConfigureAwait ( false ) ; await xmlWriter . WriteEndDocumentAsync ( ) . ConfigureAwait ( false ) ; await xmlWriter . FlushAsync ( ) . ConfigureAwait ( false ) ; }
Writes the specified error response into the destination stream as XML.
Writes the specified error response into the destination stream as XML .
ErrorResponse
this
destination
Stream
The stream to write the response into.
The stream to write the response into .
errorResponse
The error response to write.
The error response to write .