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)

public static IDictionary<stringobject> ObjectToDictionary(
	object value
)

Parameters

value
Type: System.Object

The object to be converted.

Return Value

Type: System.Collections.Generic.IDictionary<StringObject>

The created dictionary of property names and property values.

Return to top
Show: