Share via


MetadataSerializationContext.WriteToDocument Method

Definition

Overloads

WriteToDocument(String, Stream)

Writing the context that is indexed by the specified logical-path into the provided document.

WriteToDocument(String, TextWriter, Encoding)

Writing the context that is indexed by the specified logical-path into the provided writer.

WriteToDocument(String, Stream)

Writing the context that is indexed by the specified logical-path into the provided document.

public void WriteToDocument (string logicalPath, System.IO.Stream document);
member this.WriteToDocument : string * System.IO.Stream -> unit
Public Sub WriteToDocument (logicalPath As String, document As Stream)

Parameters

logicalPath
String

The logical path that identify the content in the set of documents in the context.

document
Stream

A Stream into which the content of the document should be persisted.

Exceptions

  • The specified path is a null reference (Nothing in Visual Basic) or empty.
  • The specified document is a null reference (Nothing in Visual Basic).
  • The specified path does not exist in the context.
  • The specified document does not support writing into it.

Applies to

WriteToDocument(String, TextWriter, Encoding)

Writing the context that is indexed by the specified logical-path into the provided writer.

public void WriteToDocument (string logicalPath, System.IO.TextWriter writer, System.Text.Encoding encoding = default);
member this.WriteToDocument : string * System.IO.TextWriter * System.Text.Encoding -> unit
Public Sub WriteToDocument (logicalPath As String, writer As TextWriter, Optional encoding As Encoding = Nothing)

Parameters

logicalPath
String

The logical path that identify the content in the set of documents in the context.

writer
TextWriter

A TextWriter that should be used to persist the content of the document.

encoding
Encoding

An optional Encoding that should be used when reading the content in the context.

Exceptions

  • The specified path is a null reference (Nothing in Visual Basic) or empty.
  • The specified document is a null reference (Nothing in Visual Basic).

The specified path does not exist in the context.

Applies to