FormDataEntryValue Struct

The value of a form data entry: a string or a file (https://xhr.spec.whatwg.org/#formdataentryvalue).

public readonly struct FormDataEntryValue : IEquatable<FormDataEntryValue>
Implements

Properties

NameDescription
FileGets the value as a file, or null when the value is a string.
StringValueGets the value as a string, or null when the value is a file.
ValueGets the value: a String or a File.

Gets the value as a file, or null when the value is a string.

public File? File { get; }

Property value

File?

StringValue

FormData.cs

Gets the value as a string, or null when the value is a file.

public string? StringValue { get; }

Property value

string?

Gets the value: a String or a File.

public object Value { get; }

Property value

object

Methods

NameDescription
Equals(FormDataEntryValue)Indicates whether the current object is equal to another object of the same type.
Equals(object?)Indicates whether this instance and a specified object are equal.
FromFile(File)Creates a form data entry value from a file.
FromString(string)Creates a form data entry value from a string.
GetHashCode()Returns the hash code for this instance.
ToString()Returns the fully qualified type name of this instance.

Equals overloads

Equals(FormDataEntryValue)

FormData.cs

Indicates whether the current object is equal to another object of the same type.

public bool Equals(FormDataEntryValue other)
Parameters
other FormDataEntryValue
An object to compare with this object.
Returns

bool true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

FormData.cs

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)
Parameters
obj object?
The object to compare with the current instance.
Returns

bool true if obj and this instance are the same type and represent the same value; otherwise, false.

FromFile(File)

FormData.cs

Creates a form data entry value from a file.

public static FormDataEntryValue FromFile(File value)

Parameters

value File

Returns

FormDataEntryValue

FromString(string)

FormData.cs

Creates a form data entry value from a string.

public static FormDataEntryValue FromString(string value)

Parameters

value string

Returns

FormDataEntryValue

GetHashCode()

FormData.cs

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int A 32-bit signed integer that is the hash code for this instance.

ToString()

FormData.cs

Returns the fully qualified type name of this instance.

public override string? ToString()

Returns

string? The fully qualified type name.

Operators

NameDescription
operator ==(FormDataEntryValue, FormDataEntryValue)Determines whether two form data entry values are equal.
implicit operator FormDataEntryValue(File)Converts a file to a form data entry value.
implicit operator FormDataEntryValue(string)Converts a string to a form data entry value.
operator !=(FormDataEntryValue, FormDataEntryValue)Determines whether two form data entry values are different.

operator ==(FormDataEntryValue, FormDataEntryValue)

FormData.cs

Determines whether two form data entry values are equal.

public static bool operator ==(FormDataEntryValue left, FormDataEntryValue right)

Parameters

left FormDataEntryValue
right FormDataEntryValue

Returns

bool

op_Implicit overloads

implicit operator FormDataEntryValue(File)

FormData.cs

Converts a file to a form data entry value.

public static implicit operator FormDataEntryValue(File value)
Parameters
value File
Returns

FormDataEntryValue

implicit operator FormDataEntryValue(string)

FormData.cs

Converts a string to a form data entry value.

public static implicit operator FormDataEntryValue(string value)
Parameters
value string
Returns

FormDataEntryValue

operator !=(FormDataEntryValue, FormDataEntryValue)

FormData.cs

Determines whether two form data entry values are different.

public static bool operator !=(FormDataEntryValue left, FormDataEntryValue right)

Parameters

left FormDataEntryValue
right FormDataEntryValue

Returns

bool