DictionaryExtensions
Extension methods for IDictionary.
Definition
Namespace:Kendo.Mvc.Extensions
Assembly:Kendo.Mvc.dll
Syntax:
public static class DictionaryExtensions
Inheritance: objectDictionaryExtensions
Inherited Members
Methods
Adds a key-value pair to the dictionary if the specified condition is met.
public static IDictionary<string, object> Add<T>(this IDictionary<string, object> instance, string key, T value, Func<bool> condition)
The dictionary instance.
keystringThe key to add.
valueTThe value to add.
conditionFunc<bool>A function that returns true if the value should be added.
Returns:The dictionary instance.
Adds a key-value pair to the dictionary if the value is different from the default value.
public static IDictionary<string, object> Add<T>(this IDictionary<string, object> instance, string key, T value, T defaultValue) where T : IComparable
The dictionary instance.
keystringThe key to add.
valueTThe value to add.
defaultValueTThe default value to compare against.
Returns:The dictionary instance.
Merges the specified instance.
public static void Merge(this IDictionary<string, object> instance, IDictionary<string, object> from, bool replaceExisting)
The instance.
fromIDictionary<string, object>From.
replaceExistingboolif set to true [replace existing].
Merges the specified instance.
public static void Merge(this IDictionary<string, object> instance, IDictionary<string, object> from)
The instance.
fromIDictionary<string, object>From.
Merges the specified instance.
public static void Merge(this IDictionary<string, object> instance, object values, bool replaceExisting)
The instance.
valuesobjectThe values.
replaceExistingboolif set to true [replace existing].
Merges the specified instance.
public static void Merge(this IDictionary<string, object> instance, object values)
The instance.
valuesobjectThe values.
Merges the specified instance.
Toes the attribute string.
public static string ToAttributeString(this IDictionary<string, object> instance)
The instance.
Returns: