Azavea.Open.DAO.SQL.SqlDaLayer.AppendParameter C# (CSharp) Method

AppendParameter() public method

Since it is implementation-dependent whether to use the sql parameters collection or not, this method should be implemented in each implementation.
public AppendParameter ( SqlDaQuery queryToAddTo, object value, Type columnType ) : void
queryToAddTo SqlDaQuery Query to add the parameter to.
value object Actual value that we need to append to our SQL.
columnType System.Type Type of data actually stored in the DB column. For example, /// Enums may be stored as strings. May be null if no type cast /// is necessary.
return void
        public virtual void AppendParameter(SqlDaQuery queryToAddTo, object value,
            Type columnType)
        {
            queryToAddTo.Sql.Append("?");
            if (columnType != null)
            {
                value = CoerceType(columnType, value);
            }
            queryToAddTo.Params.Add(value);
        }