HtmlHelper.ObjectToDictionary(Object) Method

Definition

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.

public static System.Collections.Generic.IDictionary<string,object> ObjectToDictionary (object value);
static member ObjectToDictionary : obj -> System.Collections.Generic.IDictionary<string, obj>
Public Shared Function ObjectToDictionary (value As Object) As IDictionary(Of String, Object)

Parameters

value
Object

The object to be converted.

Returns

The created dictionary of property names and property values.

Applies to