Exemplo n.º 1
0
        public static PutAppendResult Append(this PagedContainerAbstract c, string key, string data)
        {
            if (string.IsNullOrEmpty(data))
            {
                throw new ArgumentException("Argument can't be null or empty", nameof(data));
            }

            return(c.Append(key, defaultEncoding.GetBytes(data)));
        }
Exemplo n.º 2
0
        public static Dictionary <string, PutAppendResult> Append(this PagedContainerAbstract c, Dictionary <string, string> keyValues)
        {
            foreach (var item in keyValues)
            {
                if (string.IsNullOrEmpty(item.Key))
                {
                    throw new ArgumentException("Argument can't be null or empty", nameof(keyValues));
                }

                if (string.IsNullOrEmpty(item.Value))
                {
                    throw new ArgumentException($"Argument can't be null or empty: {item.Key}", nameof(keyValues));
                }
            }

            return(c.Append(keyValues.ToDictionary(p => p.Key, p => defaultEncoding.GetBytes(p.Value), StringComparer.InvariantCultureIgnoreCase)));
        }