OutputFormatterWriteContext.WriterFactory 属性

定义

获取或设置一个委托,用于创建 TextWriter 用于将文本写入响应的 。

直接写入 以 Body 将二进制数据写入响应。

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)

属性值

注解

TextWriter此委托创建的 将编码文本并写入Body流。 调用此委托以创建 用于 TextWriter 将文本输出写入响应流。

若要实现将二进制数据写入响应流的格式化程序,请不要使用 WriterFactory 委托,而是使用 Body

适用于