ValueProviderResult Struct

Definition

Result of an GetValue(String) operation.

C#
public struct ValueProviderResult : IEquatable<Microsoft.AspNetCore.Mvc.ModelBinding.ValueProviderResult>, System.Collections.Generic.IEnumerable<string>
C#
public readonly struct ValueProviderResult : IEquatable<Microsoft.AspNetCore.Mvc.ModelBinding.ValueProviderResult>, System.Collections.Generic.IEnumerable<string>
Inheritance
ValueProviderResult
Implements

Remarks

ValueProviderResult can represent a single submitted value or multiple submitted values.

Use FirstValue to consume only a single value, regardless of whether a single value or multiple values were submitted.

Treat ValueProviderResult as an IEnumerable<T> to consume all values, regardless of whether a single value or multiple values were submitted.

Constructors

Fields

None

A ValueProviderResult that represents a lack of data.

Properties

Culture

Gets or sets the CultureInfo associated with the values.

FirstValue

Gets the first value based on the order values were provided in the request. Use FirstValue to get a single value for processing regardless of whether a single or multiple values were provided in the request.

Length

Gets the number of submitted values.

Values

Gets or sets the values.

Methods

Equals(Object)

Indicates whether this instance and a specified object are equal.

Equals(ValueProviderResult)

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

GetEnumerator()

Gets an IEnumerator<T> for this ValueProviderResult.

GetHashCode()

Returns the hash code for this instance.

ToString()

Returns the fully qualified type name of this instance.

Operators

Equality(ValueProviderResult, ValueProviderResult)

Compares two ValueProviderResult objects for equality.

Explicit(ValueProviderResult to String)

Converts the provided ValueProviderResult into a comma-separated string containing all submitted values.

Explicit(ValueProviderResult to String[])

Converts the provided ValueProviderResult into a an array of String containing all submitted values.

Inequality(ValueProviderResult, ValueProviderResult)

Compares two ValueProviderResult objects for inequality.

Explicit Interface Implementations

IEnumerable.GetEnumerator()

Returns an enumerator that iterates through a collection.

Extension Methods

ConvertTo(ValueProviderResult, Type)

Attempts to convert the values in result to the specified type.

ConvertTo<T>(ValueProviderResult)

Attempts to convert the values in result to the specified type.

Applies to

Product Versions
ASP.NET Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0