HtmlHelper.ObjectToDictionary(Object) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.
If the value
is already an IDictionary<TKey,TValue> instance, then it
is returned as-is.
new { data_name="value" }
will translate to the entry { "data_name", "value" }
in the resulting dictionary.
public:
static System::Collections::Generic::IDictionary<System::String ^, System::Object ^> ^ ObjectToDictionary(System::Object ^ value);
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
Returns
The created dictionary of property names and property values.