共用方式為


OutputFormatter.CanWriteResult(OutputFormatterCanWriteContext) 方法

定義

判斷這 IOutputFormatter 是否可以序列化指定型別的物件。

public:
 virtual bool CanWriteResult(Microsoft::AspNetCore::Mvc::Formatters::OutputFormatterCanWriteContext ^ context);
public virtual bool CanWriteResult (Microsoft.AspNetCore.Mvc.Formatters.OutputFormatterCanWriteContext context);
abstract member CanWriteResult : Microsoft.AspNetCore.Mvc.Formatters.OutputFormatterCanWriteContext -> bool
override this.CanWriteResult : Microsoft.AspNetCore.Mvc.Formatters.OutputFormatterCanWriteContext -> bool
Public Overridable Function CanWriteResult (context As OutputFormatterCanWriteContext) As Boolean

參數

context
OutputFormatterCanWriteContext

與呼叫相關聯的格式器內容。

傳回

true如果格式器可以寫入回應,則傳回 , false 否則傳回 。

實作

適用於