using System; namespace AsterNET.FastAGI.Command { /// /// Adds or updates an entry in the Asterisk database for a given family, key, and value.
/// Returns 1 if successful, 0 otherwise. ///
public class DatabasePutCommand : AGICommand { /// The family of the key to set. private string family; /// The key to set. private string varKey; /// The value to set. private string varValue; /// /// Get/Set the family of the key to set. /// public string Family { get { return family; } set { this.family = value; } } /// /// Get/Set the the key to set. /// public string Key { get { return varKey; } set { this.varKey = value; } } /// /// Get/Set the value to set. /// public string Value { get { return varValue; } set { this.varValue = value; } } /// /// Creates a new DatabasePutCommand. /// /// the family of the key to set. /// the key to set. /// the value to set. public DatabasePutCommand(string family, string key, string value) { this.family = family; this.varKey = key; this.varValue = value; } public override string BuildCommand() { return "DATABASE PUT " + EscapeAndQuote(family) + " " + EscapeAndQuote(varKey) + " " + EscapeAndQuote(varValue); } } }