Skip to main content

HttpMultipartParser::Extensions

Class containing various extension methods.

Public Functions

Name
boolHasParameter(this IMultipartFormDataParser parser, string name)
Returns true if the parameter has any values. False otherwise.
stringGetParameterValue(this IMultipartFormDataParser parser, string name)
Returns the value of a parameter or null if it doesn't exist.
IEnumerable< string >GetParameterValues(this IMultipartFormDataParser parser, string name)
Returns the values of a parameter or an empty enumerable if the parameter doesn't exist.

Public Functions Documentation

function HasParameter

static bool HasParameter(
this IMultipartFormDataParser parser,
string name
)

Returns true if the parameter has any values. False otherwise.

Parameters:

  • parser The multipart form parser.
  • name The name of the parameter.

Return: True if the parameter exists. False otherwise.

function GetParameterValue

static string GetParameterValue(
this IMultipartFormDataParser parser,
string name
)

Returns the value of a parameter or null if it doesn't exist.

Parameters:

  • parser The multipart form parser.
  • name The name of the parameter.

Return: The value of the parameter.

You should only use this method if you're sure the parameter has only one value.

If you need to support multiple values use GetParameterValues.

function GetParameterValues

static IEnumerable< string > GetParameterValues(
this IMultipartFormDataParser parser,
string name
)

Returns the values of a parameter or an empty enumerable if the parameter doesn't exist.

Parameters:

  • parser The multipart form parser.
  • name The name of the parameter.

Return: The values of the parameter.