Class ValueProviderResult
- Namespace
- System.Web.Http.ValueProviders
- Assembly
- System.Web.Http.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.
public ValueProviderResult(object rawValue, string attemptedValue, CultureInfo culture)
Parameters
rawValueobjectThe raw value.
attemptedValuestringThe attempted value.
cultureCultureInfoThe 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 that is converted to a string for display.
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 that is supplied by the value provider.
Methods
ConvertTo(Type)
Converts the value that is encapsulated by this result to the specified type.
public object ConvertTo(Type type)
Parameters
typeTypeThe target type.
Returns
- object
The converted value.
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
typeTypeThe target type.
cultureCultureInfoThe culture to use in the conversion.
Returns
- object
The converted value.