protected virtual void AddParameterForFieldToCommand(IDbCommand command, FieldDefinition fieldDef, object objWithProperties)
{
var p = command.CreateParameter();
p.ParameterName = string.Format("{0}{1}", ParamString, fieldDef.FieldName);
if (DbTypeMap.ColumnDbTypeMap.ContainsKey(fieldDef.FieldType))
{
p.DbType = DbTypeMap.ColumnDbTypeMap[fieldDef.FieldType];
p.Value = GetValueOrDbNull(fieldDef, objWithProperties);
}
else
{
var unquotedVal = fieldDef.GetQuotedValue(objWithProperties).TrimStart('\'').TrimEnd('\'');
p.DbType = DbType.String;
p.Value = GetValueOrDbNull(unquotedVal);
}
command.Parameters.Add(p);
}