共用方式為


IOutputFormatter.CanWriteResult(OutputFormatterCanWriteContext) 方法

定義

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

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

參數

context
OutputFormatterCanWriteContext

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

傳回

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

適用於