Compartir a través de


DefaultOutputFormatterSelector.SelectFormatter Método

Definición

Selecciona un IOutputFormatter objeto para escribir la respuesta en función de los valores proporcionados y la solicitud actual.

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

Parámetros

context
OutputFormatterCanWriteContext

asociado OutputFormatterCanWriteContext a la solicitud actual.

formatters
IList<IOutputFormatter>

Lista de formateadores que se van a usar; esto actúa como invalidación para OutputFormatters.

contentTypes
MediaTypeCollection

Devoluciones

El objeto seleccionado IOutputFormattero null si no se pudo seleccionar uno.

Se aplica a