HelpPageSampleGenerator.WriteSampleObjectUsingFormatter Method

Writes the sample object using formatter.
<SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "The exception is recorded as InvalidSample.")> _ 
Public Overridable Function WriteSampleObjectUsingFormatter( _ 
ByVal formatter As MediaTypeFormatter, _ 
ByVal value As Object, _ 
ByVal type As Type, _ 
ByVal mediaType As MediaTypeHeaderValue
) As Object
This language is not supported or no code example is available.
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "The exception is recorded as InvalidSample.")] 
public virtual object WriteSampleObjectUsingFormatter( 
MediaTypeFormatter formatter
object value
Type type
MediaTypeHeaderValue mediaType 
)
This language is not supported or no code example is available.
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "The exception is recorded as InvalidSample.")] 
public:  
virtual object^ WriteSampleObjectUsingFormatter( 
MediaTypeFormatter^ formatter
object^ value
Type^ type
MediaTypeHeaderValue^ mediaType 
)
This language is not supported or no code example is available.
public  
SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "The exception is recorded as InvalidSample.") 
function WriteSampleObjectUsingFormatter( 
formatter : MediaTypeFormatter
value : object
type : Type
mediaType : MediaTypeHeaderValue 
) : object;
This language is not supported or no code example is available.

Parameters

formatter
MediaTypeFormatter

The formatter.

value
object

The value.

type
Type

The type.

mediaType
MediaTypeHeaderValue

Type of the media.

Return Value

object

.NET Framework

Supported in: 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8

In this article

Definition