Table of Contents

Class ValueProviderResult

Namespace
System.Web.Mvc
Assembly
System.Web.Mvc.dll

Represents the result of binding a value (such as from a form post or query string) to an action-method argument property, or to the argument itself.

public class ValueProviderResult
Inheritance
ValueProviderResult
Inherited Members

Constructors

ValueProviderResult()

Initializes a new instance of the ValueProviderResult class.

protected ValueProviderResult()

ValueProviderResult(object, string, CultureInfo)

Initializes a new instance of the ValueProviderResult class by using the specified raw value, attempted value, and culture information.

public ValueProviderResult(object rawValue, string attemptedValue, CultureInfo culture)

Parameters

rawValue object

The raw value.

attemptedValue string

The attempted value.

culture CultureInfo

The culture.

Properties

AttemptedValue

Gets or sets the raw value that is converted to a string for display.

public string AttemptedValue { get; protected set; }

Property Value

string

The raw value.

Culture

Gets or sets the culture.

public CultureInfo Culture { get; protected set; }

Property Value

CultureInfo

The culture.

RawValue

Gets or set the raw value that is supplied by the value provider.

public object RawValue { get; protected set; }

Property Value

object

The raw value.

Methods

ConvertTo(Type)

Converts the value that is encapsulated by this result to the specified type.

public object ConvertTo(Type type)

Parameters

type Type

The target type.

Returns

object

The converted value.

Exceptions

ArgumentNullException

The type parameter is null.

ConvertTo(Type, CultureInfo)

Converts the value that is encapsulated by this result to the specified type by using the specified culture information.

public virtual object ConvertTo(Type type, CultureInfo culture)

Parameters

type Type

The target type.

culture CultureInfo

The culture to use in the conversion.

Returns

object

The converted value.

Exceptions

ArgumentNullException

The type parameter is null.