HtmlHelper.ObjectToDictionary Method (Object)
Creates a dictionary from an object, by adding each public instance property as a key with its associated value to the dictionary. It will expose public properties from derived types as well. This is typically used with objects of an anonymous type.
Namespace: System.Web.Mvc
Assembly: System.Web.Mvc (in System.Web.Mvc.dll)
Syntax
public static IDictionary<string, object> ObjectToDictionary(
object value
)
public:
static IDictionary<String^, Object^>^ ObjectToDictionary(
Object^ value
)
static member ObjectToDictionary :
value:Object -> IDictionary<string, Object>
Public Shared Function ObjectToDictionary (
value As Object
) As IDictionary(Of String, Object)
Parameters
value
Type: System.ObjectThe object to be converted.
Return Value
Type: System.Collections.Generic.IDictionary<String, Object>
The created dictionary of property names and property values.
See Also
HtmlHelper Class
System.Web.Mvc Namespace
Return to top