OutputFormatterWriteContext.WriterFactory Property

Definition

Gets or sets a delegate used to create a TextWriter for writing text to the response.

Write to Body directly to write binary data to the response.

public:  virtual property Func<System::IO::Stream ^, System::Text::Encoding ^, System::IO::TextWriter ^> ^ WriterFactory {  public:
Func<System::IO::Stream ^, System::Text::Encoding ^, System::IO::TextWriter ^> ^ get(); protected:
 void set(Func<System::IO::Stream ^, System::Text::Encoding ^, System::IO::TextWriter ^> ^ value); };
public virtual Func<System.IO.Stream,System.Text.Encoding,System.IO.TextWriter> WriterFactory { get; protected set; }
member this.WriterFactory : Func<System.IO.Stream, System.Text.Encoding, System.IO.TextWriter> with get, set
Public Overridable Property WriterFactory As Func(Of Stream, Encoding, TextWriter)

Property Value

Remarks

The TextWriter created by this delegate will encode text and write to the Body stream. Call this delegate to create a TextWriter for writing text output to the response stream.

To implement a formatter that writes binary data to the response stream, do not use the WriterFactory delegate, and use Body instead.

Applies to