Telerik.Web.Mvc.Extensions.DictionaryExtensions.PrependInValue C# (CSharp) Method

PrependInValue() public static method

Appends the specified value at the beginning of the existing value
public static PrependInValue ( object>.this instance, string key, string separator, object value ) : void
instance object>.this
key string
separator string
value object
return void
        public static void PrependInValue(this IDictionary<string, object> instance, string key, string separator, object value)
        {
            Guard.IsNotNull(instance, "instance");
            Guard.IsNotNullOrEmpty(key, "key");
            Guard.IsNotNullOrEmpty(separator, "separator");
            Guard.IsNotNull(value, "value");

            instance[key] = instance.ContainsKey(key) ? value + separator + instance[key] : value.ToString();
        }