public IConnection Data(params string[] keyvals) { if (keyvals == null) { throw new ArgumentNullException("keyvals"); } if ((keyvals.Length % 2) != 0) { throw new InvalidOperationException("Must supply an even number of key value pairs"); } for (int i = 0; i < keyvals.Length; i += 2) { string key = keyvals[i]; string value = keyvals[i + 1]; if (string.IsNullOrEmpty(key)) { throw new ArgumentException("Data key must not be empty"); } if (value == null) { throw new ArgumentException("Data value must not be null"); } req.Data(KeyVal.Create(key, value)); } return(this); }
public IRequest Data(KeyVal keyval) { if (keyval == null) { throw new ArgumentNullException("keyval"); } _data.Add(keyval); return(this); }
public IConnection Data(IDictionary <string, string> data) { if (data == null) { throw new ArgumentNullException("data"); } foreach (KeyValuePair <string, string> entry in data) { req.Data(KeyVal.Create(entry.Key, entry.Value)); } return(this); }
public IConnection Data(string key, string value) { req.Data(KeyVal.Create(key, value)); return(this); }