Code Snippet Details

<- Back to List


Language
C#.Net
Description
GenericCommand
Code
using System; using System.Collections.Generic; namespace Alphabet.Framework.DAL { public class GenericCommand { #region Constructors public GenericCommand(string commandText) { if (commandText == string.Empty) { throw new ArgumentException("Command text was not set for the command object."); } else { _CommandText = commandText; } } public GenericCommand(string commandText, ref GenericParameters parameterValues) { _CommandText = commandText; _GenericParameters = parameterValues; } #endregion #region Properties private string _CommandText = string.Empty; public string CommandText { get { return _CommandText; } set { _CommandText = value; } } private GenericParameters _GenericParameters = new GenericParameters(); public GenericParameters GenericParameters { get { return _GenericParameters; } set { _GenericParameters = value; } } public Dictionary<string, GenericParameter>.ValueCollection GenericParameterValues() { return _GenericParameters.Values(); } #endregion } }