Sdílet prostřednictvím


DefaultOutputFormatterSelector.SelectFormatter Metoda

Definice

Vybere pro IOutputFormatter zápis odpovědi na základě zadaných hodnot a aktuálního požadavku.

public:
 override Microsoft::AspNetCore::Mvc::Formatters::IOutputFormatter ^ SelectFormatter(Microsoft::AspNetCore::Mvc::Formatters::OutputFormatterCanWriteContext ^ context, System::Collections::Generic::IList<Microsoft::AspNetCore::Mvc::Formatters::IOutputFormatter ^> ^ formatters, Microsoft::AspNetCore::Mvc::Formatters::MediaTypeCollection ^ contentTypes);
public override Microsoft.AspNetCore.Mvc.Formatters.IOutputFormatter SelectFormatter (Microsoft.AspNetCore.Mvc.Formatters.OutputFormatterCanWriteContext context, System.Collections.Generic.IList<Microsoft.AspNetCore.Mvc.Formatters.IOutputFormatter> formatters, Microsoft.AspNetCore.Mvc.Formatters.MediaTypeCollection contentTypes);
public override Microsoft.AspNetCore.Mvc.Formatters.IOutputFormatter? SelectFormatter (Microsoft.AspNetCore.Mvc.Formatters.OutputFormatterCanWriteContext context, System.Collections.Generic.IList<Microsoft.AspNetCore.Mvc.Formatters.IOutputFormatter> formatters, Microsoft.AspNetCore.Mvc.Formatters.MediaTypeCollection contentTypes);
override this.SelectFormatter : Microsoft.AspNetCore.Mvc.Formatters.OutputFormatterCanWriteContext * System.Collections.Generic.IList<Microsoft.AspNetCore.Mvc.Formatters.IOutputFormatter> * Microsoft.AspNetCore.Mvc.Formatters.MediaTypeCollection -> Microsoft.AspNetCore.Mvc.Formatters.IOutputFormatter
Public Overrides Function SelectFormatter (context As OutputFormatterCanWriteContext, formatters As IList(Of IOutputFormatter), contentTypes As MediaTypeCollection) As IOutputFormatter

Parametry

context
OutputFormatterCanWriteContext

Přidružený OutputFormatterCanWriteContext k aktuálnímu požadavku.

formatters
IList<IOutputFormatter>

Seznam formátovacích prostředků, které se mají použít; funguje jako přepsání na OutputFormatters.

contentTypes
MediaTypeCollection

Návraty

Vybraná IOutputFormatterhodnota nebo null , pokud ji nelze vybrat.

Platí pro