Class ValueProviderResult
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
objectThe raw value.
attemptedValue
stringThe attempted value.
culture
CultureInfoThe 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
TypeThe 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
TypeThe target type.
culture
CultureInfoThe culture to use in the conversion.
Returns
- object
The converted value.
Exceptions
- ArgumentNullException
The
type
parameter is null.