Share via


MediaType Constructors

Definition

Overloads

MediaType(StringSegment)

Initializes a MediaType instance.

MediaType(String)

Initializes a MediaType instance.

MediaType(String, Int32, Nullable<Int32>)

Initializes a Microsoft.AspNetCore.Mvc.Formatters.MediaType.MediaTypeParameterParser instance.

MediaType(StringSegment)

Source:
MediaType.cs
Source:
MediaType.cs
Source:
MediaType.cs

Initializes a MediaType instance.

public:
 MediaType(Microsoft::Extensions::Primitives::StringSegment mediaType);
public MediaType (Microsoft.Extensions.Primitives.StringSegment mediaType);
new Microsoft.AspNetCore.Mvc.Formatters.MediaType : Microsoft.Extensions.Primitives.StringSegment -> Microsoft.AspNetCore.Mvc.Formatters.MediaType
Public Sub New (mediaType As StringSegment)

Parameters

mediaType
StringSegment

The StringSegment with the media type.

Applies to

MediaType(String)

Source:
MediaType.cs
Source:
MediaType.cs
Source:
MediaType.cs

Initializes a MediaType instance.

public:
 MediaType(System::String ^ mediaType);
public MediaType (string mediaType);
new Microsoft.AspNetCore.Mvc.Formatters.MediaType : string -> Microsoft.AspNetCore.Mvc.Formatters.MediaType
Public Sub New (mediaType As String)

Parameters

mediaType
String

The String with the media type.

Applies to

MediaType(String, Int32, Nullable<Int32>)

Source:
MediaType.cs
Source:
MediaType.cs
Source:
MediaType.cs

Initializes a Microsoft.AspNetCore.Mvc.Formatters.MediaType.MediaTypeParameterParser instance.

public:
 MediaType(System::String ^ mediaType, int offset, Nullable<int> length);
public MediaType (string mediaType, int offset, int? length);
new Microsoft.AspNetCore.Mvc.Formatters.MediaType : string * int * Nullable<int> -> Microsoft.AspNetCore.Mvc.Formatters.MediaType
Public Sub New (mediaType As String, offset As Integer, length As Nullable(Of Integer))

Parameters

mediaType
String

The String with the media type.

offset
Int32

The offset in the mediaType where the parsing starts.

length
Nullable<Int32>

The length of the media type to parse if provided.

Applies to