/// <summary> /// Appends fragments from dictionary /// </summary> /// <param name="bld"></param> /// <param name="fragmentDictionary"></param> /// <exception cref="ArgumentNullException"></exception> /// <returns></returns> public static UriBuilder WithFragment(this UriBuilder bld, IDictionary <string, string> fragmentDictionary) { if (fragmentDictionary == null) { throw new ArgumentNullException(nameof(fragmentDictionary)); } foreach (var item in fragmentDictionary) { bld.WithFragment(item.Key, item.Value); } return(bld); }
/// <summary> /// Appends a fragments parameter with a key, and many values. Multiple values will be comma seperated. If only 1 value is passed and its null or value, the key will be added to the fragment. /// </summary> /// <param name="bld"></param> /// <param name="key"></param> /// <param name="values"></param> /// <returns></returns> public static UriBuilder WithFragment(this UriBuilder bld, string key, params string[] values) => bld.WithFragment(key, valuesEnum: values);